Package org.bouncycastle.openpgp
Class PGPSignatureVerifierBuilder
java.lang.Object
org.bouncycastle.openpgp.PGPSignatureVerifierBuilder
Builder for thread-safe verifiers for a range of PGP signature types.
-
Constructor Summary
ConstructorDescriptionPGPSignatureVerifierBuilder
(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey verificationKey) Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuildCertificationVerifier
(PGPSignature certification, byte[] rawUserID, PGPPublicKey publicKey) Return a verifier for a signature as certifying the passed in public key as associated with the passed in raw user ID.buildCertificationVerifier
(PGPSignature certification, String userID, PGPPublicKey publicKey) Return a verifier for a signature as certifying the passed in public key as associated with the passed in user ID.buildCertificationVerifier
(PGPSignature certification, PGPUserAttributeSubpacketVector userAttributes, PGPPublicKey publicKey) Return a verifier for a signature as certifying the passed in public key as associated with the passed in user attributes.buildDirectKeyVerifier
(PGPSignature certification, PGPPublicKey publicKey) Instantiate a signature verifier for aPGPSignature.DIRECT_KEY
signature.buildKeyRevocationVerifier
(PGPSignature certification, PGPPublicKey publicKey) Instantiate a signature verifier for aPGPSignature.KEY_REVOCATION
signature.buildPrimaryKeyBindingVerifier
(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) Instantiate a signature verifier for aPGPSignature.PRIMARYKEY_BINDING
signature.buildSubKeyBindingVerifier
(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) Instantiate a signature verifier for aPGPSignature.SUBKEY_BINDING
signature.buildSubKeyRevocationVerifier
(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) Instantiate a signature verifier for aPGPSignature.SUBKEY_REVOCATION
signature.
-
Constructor Details
-
PGPSignatureVerifierBuilder
public PGPSignatureVerifierBuilder(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey verificationKey) Base constructor.- Parameters:
verifierBuilderProvider
- provider to build verifiers from.verificationKey
- the public key which corresponds to the signing key generating the signatures we are looking at.
-
-
Method Details
-
buildDirectKeyVerifier
public PGPSignatureVerifier buildDirectKeyVerifier(PGPSignature certification, PGPPublicKey publicKey) throws PGPException Instantiate a signature verifier for aPGPSignature.DIRECT_KEY
signature.- Parameters:
certification
- the PGP signature containing the certification.publicKey
- public key subject for the direct key signature.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildKeyRevocationVerifier
public PGPSignatureVerifier buildKeyRevocationVerifier(PGPSignature certification, PGPPublicKey publicKey) throws PGPException Instantiate a signature verifier for aPGPSignature.KEY_REVOCATION
signature.- Parameters:
certification
- the PGP signature containing the certification.publicKey
- public key subject for key revocation signature.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildPrimaryKeyBindingVerifier
public PGPSignatureVerifier buildPrimaryKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) throws PGPException Instantiate a signature verifier for aPGPSignature.PRIMARYKEY_BINDING
signature.- Parameters:
certification
- the PGP signature containing the certification.primaryKey
- primary key for the primary key binding signature.subKey
- sub-key for the primary key binding signature.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildSubKeyBindingVerifier
public PGPSignatureVerifier buildSubKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) throws PGPException Instantiate a signature verifier for aPGPSignature.SUBKEY_BINDING
signature.- Parameters:
certification
- the PGP signature containing the certification.primaryKey
- primary key for the sub-key binding signature.subKey
- sub-key for the sub-key binding signature.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildSubKeyRevocationVerifier
public PGPSignatureVerifier buildSubKeyRevocationVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) throws PGPException Instantiate a signature verifier for aPGPSignature.SUBKEY_REVOCATION
signature.- Parameters:
certification
- the PGP signature containing the certification.primaryKey
- primary key for the sub-key key revocation signature.subKey
- sub-key for the sub-key key revocation signature.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildCertificationVerifier
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, String userID, PGPPublicKey publicKey) throws PGPException Return a verifier for a signature as certifying the passed in public key as associated with the passed in user ID.- Parameters:
userID
- the user ID, will be converted to UTF8.publicKey
- the key to be verified.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildCertificationVerifier
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, byte[] rawUserID, PGPPublicKey publicKey) throws PGPException Return a verifier for a signature as certifying the passed in public key as associated with the passed in raw user ID.- Parameters:
rawUserID
- raw encoding of the user ID (assumed a UTF8 string, not user attributes)publicKey
- the key to be verified.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-
buildCertificationVerifier
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, PGPUserAttributeSubpacketVector userAttributes, PGPPublicKey publicKey) throws PGPException Return a verifier for a signature as certifying the passed in public key as associated with the passed in user attributes.- Parameters:
userAttributes
- user attributes the key was stored underpublicKey
- the key to be verified.- Returns:
- a verifier.
- Throws:
PGPException
- if signature type is wrong or there is a problem constructing the verifier.
-