Beispiel #1
0
 public byte[] decryptFrom(EncryptedData encryptedData, String recipientSecretPhrase) {
   if (getPublicKey() == null) {
     throw new IllegalArgumentException("Sender account doesn't have a public key set");
   }
   return encryptedData.decrypt(Crypto.getPrivateKey(recipientSecretPhrase), publicKey);
 }
Beispiel #2
0
 public EncryptedData encryptTo(byte[] data, String senderSecretPhrase) {
   if (getPublicKey() == null) {
     throw new IllegalArgumentException("Recipient account doesn't have a public key set");
   }
   return EncryptedData.encrypt(data, Crypto.getPrivateKey(senderSecretPhrase), publicKey);
 }