/** * 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); }