Class DefaultPGPPublicKeyAccessor

java.lang.Object
org.apache.camel.converter.crypto.DefaultPGPPublicKeyAccessor
All Implemented Interfaces:
PGPPublicKeyAccessor

public class DefaultPGPPublicKeyAccessor extends Object implements PGPPublicKeyAccessor
Caches a public key ring.
  • Constructor Details

    • DefaultPGPPublicKeyAccessor

      public DefaultPGPPublicKeyAccessor(byte[] publicKeyRing) throws IOException, org.bouncycastle.openpgp.PGPException
      Throws:
      IOException
      org.bouncycastle.openpgp.PGPException
  • Method Details

    • getEncryptionKeys

      public List<org.bouncycastle.openpgp.PGPPublicKey> getEncryptionKeys(org.apache.camel.Exchange exchange, List<String> useridParts) throws Exception
      Description copied from interface: PGPPublicKeyAccessor
      Returns the encryption keys for the given user ID parts. This method is used for encryption.
      Specified by:
      getEncryptionKeys in interface PGPPublicKeyAccessor
      Parameters:
      exchange - exchange, can be null
      useridParts - parts of User IDs, must not be null
      Returns:
      list of public keys, must not be null
      Throws:
      Exception
    • getPublicKey

      public org.bouncycastle.openpgp.PGPPublicKey getPublicKey(org.apache.camel.Exchange exchange, long keyId, List<String> userIdParts) throws Exception
      Description copied from interface: PGPPublicKeyAccessor
      Returns the public key with a certain key ID. This method is used for verifying the signature. The given User IDs are provided to filter the public key, further. If the User ID parts list is empty, then any public key can be returned which has the specified key ID. If the User ID parts list is not empty then the returned key must have a User ID which contains at least one User ID part.
      Specified by:
      getPublicKey in interface PGPPublicKeyAccessor
      Parameters:
      exchange - exchange
      keyId - key ID
      userIdParts - parts of User IDs, must not be null, but can be empty
      Returns:
      public key or null if the key cannot be found
      Throws:
      Exception