/** * Builds a PublicKeyKeyEncryptionMethodGenerator * for the specified key. */ protected PBEKeyEncryptionMethodGenerator buildSymmetricKeyEncryptor() throws PGPException { if (log.isLoggable(Level.INFO)) log.info("using symmetric encryption with " + keyDerivationAlgorithm + " hash, work factor " + keyDerivationWorkFactor); int algo = keyDerivationAlgorithm.ordinal(); return new BcPBEKeyEncryptionMethodGenerator( symmetricPassphrase.toCharArray(), new BcPGPDigestCalculatorProvider().get(algo), keyDerivationWorkFactor); }
/** * Provide a user defined source of randomness. * * @param random the secure random to be used. * @return the current generator. */ public PBEKeyEncryptionMethodGenerator setSecureRandom(SecureRandom random) { super.setSecureRandom(random); return this; }
public PBEKeyEncryptionMethodGenerator setSecureRandom(SecureRandom random) { super.setSecureRandom(random); return this; }