GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Missing asymmetric encryption method in ASAPCryptoAlgorithms · Issue #10 · SharedKnowledge/ASAPJava Open DescriptionThe class Here is an example implementation: /** * Uses asymmetric encryption to encrypt the unencryptedBytes using the public key of the recipient. * @param unencryptedBytes bytes to encrypt * @param recipient identifier of the recipient * @param ASAPKeyStore key store that holds the public key of the recipient * @return encrypted bytes * @throws ASAPSecurityException if the public key is missing or other problems occurred during encryption */ public static byte[] encryptAsymmetric(byte[] unencryptedBytes, CharSequence recipient, ASAPKeyStore ASAPKeyStore) throws ASAPSecurityException { PublicKey publicKey = ASAPKeyStore.getPublicKey(recipient); if (publicKey == null) { throw new ASAPSecurityException("recipients' public key cannot be found"); } else { try { Cipher cipher = Cipher.getInstance(ASAPKeyStore.getAsymmetricEncryptionAlgorithm()); cipher.init(1, publicKey); return cipher.doFinal(unencryptedBytes); } catch (InvalidKeyException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException | NoSuchAlgorithmException e) { throw new ASAPSecurityException("problems when encrypting", e); } } } ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |