Fix ElGamal key creation, SUBKEY_BINDING cert must use algo of master key

This commit is contained in:
Dominik Schürmann 2014-08-16 13:30:13 +02:00
parent 4d698c896a
commit c1f9c5e4b5

View File

@ -933,7 +933,7 @@ public class PgpKeyOperation {
} }
PGPContentSignerBuilder signerBuilder = new JcaPGPContentSignerBuilder( PGPContentSignerBuilder signerBuilder = new JcaPGPContentSignerBuilder(
pKey.getAlgorithm(), PGPUtil.SHA1) masterPrivateKey.getPublicKeyPacket().getAlgorithm(), PGPUtil.SHA1)
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME); .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME);
PGPSignatureGenerator sGen = new PGPSignatureGenerator(signerBuilder); PGPSignatureGenerator sGen = new PGPSignatureGenerator(signerBuilder);
sGen.init(PGPSignature.SUBKEY_BINDING, masterPrivateKey); sGen.init(PGPSignature.SUBKEY_BINDING, masterPrivateKey);