org.apache.camel.converter.crypto
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.
Method Summary |
List<org.bouncycastle.openpgp.PGPPublicKey> |
getEncryptionKeys(org.apache.camel.Exchange exchange,
List<String> useridParts)
Returns the encryption keys for the given user ID parts. |
org.bouncycastle.openpgp.PGPPublicKey |
getPublicKey(org.apache.camel.Exchange exchange,
long keyId,
List<String> userIdParts)
Returns the public key with a certain key ID. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultPGPPublicKeyAccessor
public DefaultPGPPublicKeyAccessor(byte[] publicKeyRing)
throws IOException,
org.bouncycastle.openpgp.PGPException
- Throws:
IOException
org.bouncycastle.openpgp.PGPException
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
- exchangekeyId
- key IDuserIdParts
- 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
Apache Camel