Package org.bouncycastle.openpgp
Class PGPSignatureVerifierBuilder
- java.lang.Object
-
- org.bouncycastle.openpgp.PGPSignatureVerifierBuilder
-
public class PGPSignatureVerifierBuilder extends java.lang.Object
Builder for thread-safe verifiers for a range of PGP signature types.
-
-
Constructor Summary
Constructors Constructor Description PGPSignatureVerifierBuilder(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey verificationKey)
Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PGPSignatureVerifier
buildCertificationVerifier(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.PGPSignatureVerifier
buildCertificationVerifier(PGPSignature certification, java.lang.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.PGPSignatureVerifier
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.PGPSignatureVerifier
buildDirectKeyVerifier(PGPSignature certification, PGPPublicKey publicKey)
Instantiate a signature verifier for aPGPSignature.DIRECT_KEY
signature.PGPSignatureVerifier
buildKeyRevocationVerifier(PGPSignature certification, PGPPublicKey publicKey)
Instantiate a signature verifier for aPGPSignature.KEY_REVOCATION
signature.PGPSignatureVerifier
buildPrimaryKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey)
Instantiate a signature verifier for aPGPSignature.PRIMARYKEY_BINDING
signature.PGPSignatureVerifier
buildSubKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey)
Instantiate a signature verifier for aPGPSignature.SUBKEY_BINDING
signature.PGPSignatureVerifier
buildSubKeyRevocationVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey)
Instantiate a signature verifier for aPGPSignature.SUBKEY_REVOCATION
signature.
-
-
-
Constructor Detail
-
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 Detail
-
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, java.lang.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.
-
-