Mark Riordan created CAMEL-7106:
-----------------------------------

             Summary: PGP decryption sometimes can't find the secret key
                 Key: CAMEL-7106
                 URL: https://issues.apache.org/jira/browse/CAMEL-7106
             Project: Camel
          Issue Type: Bug
          Components:  camel-crypto
    Affects Versions: 2.12.2
            Reporter: Mark Riordan


Camel Crypto fails to decrypt PGP files encrypted by GnuPG and other programs, 
when the secret key used to encrypt the symmetric key is not the first on the 
keyring (using Bouncy Castle's definition of a keyring). The error message is 
"Provided input is encrypted with unknown pair of keys."  Since the encryption 
key in files from other PGP programs normally is a subkey and is not the first 
one in the keyring (which is typically the master key), this means that 
decryption fails in many cases.

The fix is a one-liner to PGPDataFormatUtil.findPrivateKeyWithKeyId(), to use a 
BC method that searches for the secret key rather than assume it's the first 
one on the secret keyring.  I will attach a patch.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to