Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPSignatureVerifierBuilder

extends Object
Class Inheritance
Imports
org.bouncycastle.openpgp.operator.PGPContentVerifierBuilderProvider, org.bouncycastle.util.Strings

Builder for thread-safe verifiers for a range of PGP signature types.

Field Summary

Modifier and TypeField and Description
private final PGPPublicKey
private final PGPContentVerifierBuilderProvider

Constructor Summary

AccessConstructor and Description
public
PGPSignatureVerifierBuilder(PGPContentVerifierBuilderProvider
provider to build verifiers from.
verifierBuilderProvider
,
PGPPublicKey
the public key which corresponds to the signing key generating the signatures we are looking at.
verificationKey
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public PGPSignatureVerifier

Returns:

a verifier.
buildCertificationVerifier
(PGPSignature certification, String
the user ID, will be converted to UTF8.
userID
,
final PGPPublicKey
the key to be verified.
publicKey
)

Return a verifier for a signature as certifying the passed in public key as associated with the passed in user ID.

public PGPSignatureVerifier

Returns:

a verifier.
buildCertificationVerifier
(PGPSignature certification, byte[]
raw encoding of the user ID (assumed a UTF8 string, not user attributes)
rawUserID
,
final PGPPublicKey
the key to be verified.
publicKey
)

Return a verifier for a signature as certifying the passed in public key as associated with the passed in raw user ID.

public PGPSignatureVerifier

Returns:

a verifier.
buildCertificationVerifier
(PGPSignature certification, PGPUserAttributeSubpacketVector
user attributes the key was stored under
userAttributes
,
final PGPPublicKey
the key to be verified.
publicKey
)

Return a verifier for a signature as certifying the passed in public key as associated with the passed in user attributes.

public PGPSignatureVerifier

Returns:

a verifier.
buildDirectKeyVerifier
(PGPSignature
the PGP signature containing the certification.
certification
,
final PGPPublicKey
public key subject for the direct key signature.
publicKey
)

Instantiate a signature verifier for a PGPSignature#DIRECT_KEY signature.

public PGPSignatureVerifier

Returns:

a verifier.
buildKeyRevocationVerifier
(PGPSignature
the PGP signature containing the certification.
certification
,
final PGPPublicKey
public key subject for key revocation signature.
publicKey
)

Instantiate a signature verifier for a PGPSignature#KEY_REVOCATION signature.

public PGPSignatureVerifier

Returns:

a verifier.
buildPrimaryKeyBindingVerifier
(PGPSignature
the PGP signature containing the certification.
certification
,
PGPPublicKey
primary key for the primary key binding signature.
primaryKey
,
PGPPublicKey
sub-key for the primary key binding signature.
subKey
)

Instantiate a signature verifier for a PGPSignature#PRIMARYKEY_BINDING signature.

public PGPSignatureVerifier

Returns:

a verifier.
buildSubKeyBindingVerifier
(PGPSignature
the PGP signature containing the certification.
certification
,
PGPPublicKey
primary key for the sub-key binding signature.
primaryKey
,
PGPPublicKey
sub-key for the sub-key binding signature.
subKey
)

Instantiate a signature verifier for a PGPSignature#SUBKEY_BINDING signature.

public PGPSignatureVerifier

Returns:

a verifier.
buildSubKeyRevocationVerifier
(PGPSignature
the PGP signature containing the certification.
certification
,
final PGPPublicKey
primary key for the sub-key key revocation signature.
primaryKey
,
final PGPPublicKey
sub-key for the sub-key key revocation signature.
subKey
)

Instantiate a signature verifier for a PGPSignature#SUBKEY_REVOCATION signature.

private PGPSignature
private PGPSignatureVerifier
doBuildCertificationVerifier(PGPSignature certification, final byte[] rawUserID, final PGPPublicKey publicKey)

private PGPSignatureVerifier
doBuildCertificationVerifier(PGPSignature certification, final PGPUserAttributeSubpacketVector userAttributes, final PGPPublicKey publicKey)

private PGPSignatureVerifier
doBuildKeyBindingVerifier(PGPSignature certification, final PGPPublicKey primaryKey, final PGPPublicKey subKey)

private PGPSignatureVerifier
doBuildKeyCertificationVerifier(PGPSignature keyCertification, final PGPPublicKey publicKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

verificationKeyback to summary
private final PGPPublicKey verificationKey
verifierBuilderProviderback to summary
private final PGPContentVerifierBuilderProvider verifierBuilderProvider

Constructor Detail

PGPSignatureVerifierBuilderback to summary
public PGPSignatureVerifierBuilder(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey verificationKey)

Base constructor.

Parameters
verifierBuilderProvider:PGPContentVerifierBuilderProvider

provider to build verifiers from.

verificationKey:PGPPublicKey

the public key which corresponds to the signing key generating the signatures we are looking at.

Method Detail

buildCertificationVerifierback to summary
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, String userID, final 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:String

the user ID, will be converted to UTF8.

publicKey:PGPPublicKey

the key to be verified.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildCertificationVerifierback to summary
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, byte[] rawUserID, final 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:byte[]

raw encoding of the user ID (assumed a UTF8 string, not user attributes)

publicKey:PGPPublicKey

the key to be verified.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildCertificationVerifierback to summary
public PGPSignatureVerifier buildCertificationVerifier(PGPSignature certification, PGPUserAttributeSubpacketVector userAttributes, final 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:PGPUserAttributeSubpacketVector

user attributes the key was stored under

publicKey:PGPPublicKey

the key to be verified.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildDirectKeyVerifierback to summary
public PGPSignatureVerifier buildDirectKeyVerifier(PGPSignature certification, final PGPPublicKey publicKey) throws PGPException

Instantiate a signature verifier for a PGPSignature#DIRECT_KEY signature.

Parameters
certification:PGPSignature

the PGP signature containing the certification.

publicKey:PGPPublicKey

public key subject for the direct key signature.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildKeyRevocationVerifierback to summary
public PGPSignatureVerifier buildKeyRevocationVerifier(PGPSignature certification, final PGPPublicKey publicKey) throws PGPException

Instantiate a signature verifier for a PGPSignature#KEY_REVOCATION signature.

Parameters
certification:PGPSignature

the PGP signature containing the certification.

publicKey:PGPPublicKey

public key subject for key revocation signature.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildPrimaryKeyBindingVerifierback to summary
public PGPSignatureVerifier buildPrimaryKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) throws PGPException

Instantiate a signature verifier for a PGPSignature#PRIMARYKEY_BINDING signature.

Parameters
certification:PGPSignature

the PGP signature containing the certification.

primaryKey:PGPPublicKey

primary key for the primary key binding signature.

subKey:PGPPublicKey

sub-key for the primary key binding signature.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildSubKeyBindingVerifierback to summary
public PGPSignatureVerifier buildSubKeyBindingVerifier(PGPSignature certification, PGPPublicKey primaryKey, PGPPublicKey subKey) throws PGPException

Instantiate a signature verifier for a PGPSignature#SUBKEY_BINDING signature.

Parameters
certification:PGPSignature

the PGP signature containing the certification.

primaryKey:PGPPublicKey

primary key for the sub-key binding signature.

subKey:PGPPublicKey

sub-key for the sub-key binding signature.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
buildSubKeyRevocationVerifierback to summary
public PGPSignatureVerifier buildSubKeyRevocationVerifier(PGPSignature certification, final PGPPublicKey primaryKey, final PGPPublicKey subKey) throws PGPException

Instantiate a signature verifier for a PGPSignature#SUBKEY_REVOCATION signature.

Parameters
certification:PGPSignature

the PGP signature containing the certification.

primaryKey:PGPPublicKey

primary key for the sub-key key revocation signature.

subKey:PGPPublicKey

sub-key for the sub-key key revocation signature.

Returns:PGPSignatureVerifier

a verifier.

Exceptions
PGPException:
if signature type is wrong or there is a problem constructing the verifier.
createLocalSigback to summary
private PGPSignature createLocalSig(PGPSignature certification) throws PGPException
doBuildCertificationVerifierback to summary
private PGPSignatureVerifier doBuildCertificationVerifier(PGPSignature certification, final byte[] rawUserID, final PGPPublicKey publicKey) throws PGPException
doBuildCertificationVerifierback to summary
private PGPSignatureVerifier doBuildCertificationVerifier(PGPSignature certification, final PGPUserAttributeSubpacketVector userAttributes, final PGPPublicKey publicKey) throws PGPException
doBuildKeyBindingVerifierback to summary
private PGPSignatureVerifier doBuildKeyBindingVerifier(PGPSignature certification, final PGPPublicKey primaryKey, final PGPPublicKey subKey) throws PGPException
doBuildKeyCertificationVerifierback to summary
private PGPSignatureVerifier doBuildKeyCertificationVerifier(PGPSignature keyCertification, final PGPPublicKey publicKey) throws PGPException