/** * Decrypts the data from <em>cipher</em> and stores the result in <em>plain</em>. * * @param cipher text, holds the cipher to be decrypted * @param plain text, holds the decrypted text after decryption * @see com.freiheit.gnupg.GnuPGData */ public void decrypt(GnuPGData cipher, GnuPGData plain) throws GnuPGException { if (cipher == null || plain == null) return; gpgmeOpDecrypt( this.getInternalRepresentation(), cipher.getInternalRepresentation(), plain.getInternalRepresentation()); }
/** * Decrypts the data from <em>cipher</em> and returns the result. * * @param cipher the data to be decrypted * @return plain the resulting decrypted data * @see com.freiheit.gnupg.GnuPGData */ public GnuPGData decrypt(String cipher) throws GnuPGException { if (cipher == null || cipher.length() == 0) throw new GnuPGException("Encryption arguments not complete."); GnuPGData plainData = createDataObject(); final GnuPGData cipherData = createDataObject(cipher); gpgmeOpDecrypt( this.getInternalRepresentation(), cipherData.getInternalRepresentation(), plainData.getInternalRepresentation()); cipherData.destroy(); return plainData; }