开发者

encrypt with BC and decrypt with pgp 6.5.8

开发者 https://www.devze.com 2023-03-31 06:32 出处:网络
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 a

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号