encrypt with BC and decrypt with pgp 6.5.8
I am trying to encrypt with BC and decrypt with pgp 6.5.8 .
The encryption asp开发者_运维百科ect of it works and i am able to decrypt i pgp 6.5.8 . But pgp 6.5.8 complains the signature is bad. Can anyone help me with this ?
Thanks
To save someone possible frustrations in the future I can provide some more details.
When encrypting the file with Bouncy Castle be sure to set the integrity packet to false. Without this PGP6.5.8 might not be able to decrypt the file.
JcePGPDataEncryptorBuilder builder = ...
builder.setWithIntegrityPacket(false);
When signing the file you might have to use V3 signatures, but this depends on the key your signing with. Use the PGPV3SignatureGenerator instead of PGPSignatureGenerator.
The reason why it did not work because I needed to construct the signature using RFC 4880 Version 3 signature, I did it using Version 4.
精彩评论