Package org.bouncycastle.openpgp.api
Class OpenPGPCertificate.OpenPGPComponentSignature
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPSignature
org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPComponentSignature
- Enclosing class:
OpenPGPCertificate
OpenPGP Signature made over some
OpenPGPCertificate.OpenPGPCertificateComponent
on a OpenPGPCertificate
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bouncycastle.openpgp.api.OpenPGPSignature
OpenPGPSignature.OpenPGPDocumentSignature, OpenPGPSignature.OpenPGPSignatureSubpacket
-
Field Summary
Fields inherited from class org.bouncycastle.openpgp.api.OpenPGPSignature
isCorrect, issuer, isTested, signature
-
Constructor Summary
ConstructorsConstructorDescriptionOpenPGPComponentSignature
(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPCertificateComponent target) Component signature. -
Method Summary
Modifier and TypeMethodDescriptionReturn theOpenPGPCertificate.OpenPGPComponentKey
that issued this signature.Return the key expiration time stored in the signature.Return theOpenPGPCertificate.OpenPGPCertificateComponent
that this signature was calculated over.protected String
Return theOpenPGPCertificate.OpenPGPComponentKey
that this signature is calculated over.void
verify
(OpenPGPImplementation implementation) Verify this signature.void
verify
(PGPContentVerifierBuilderProvider contentVerifierBuilderProvider, OpenPGPPolicy policy) Verify this signature.protected void
verifyKeySignature
(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPComponentKey target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a signature of typePGPSignature.DIRECT_KEY
,PGPSignature.KEY_REVOCATION
,PGPSignature.SUBKEY_BINDING
orPGPSignature.SUBKEY_REVOCATION
.protected void
verifyUserAttributeSignature
(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserAttribute target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a certification signature over anOpenPGPCertificate.OpenPGPUserAttribute
.protected void
verifyUserIdSignature
(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserId target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a certification signature over anOpenPGPCertificate.OpenPGPUserId
.Methods inherited from class org.bouncycastle.openpgp.api.OpenPGPSignature
getCreationTime, getExpirationTime, getIssuer, getIssuerCertificate, getIssuerDisplay, getKeyIdentifier, getKeyIdentifiers, getMostExpressiveIdentifier, getSignature, getType, isCertification, isEffectiveAt, isHardRevocation, isRevocation, isTestedCorrect, toAsciiArmoredString, toString
-
Constructor Details
-
OpenPGPComponentSignature
public OpenPGPComponentSignature(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPCertificateComponent target) Component signature.- Parameters:
signature
- signatureissuer
- key that issued the signature. Is nullable (e.g. for 3rd party sigs where the certificate is not available).target
- signed certificate component
-
-
Method Details
-
getIssuerComponent
Return theOpenPGPCertificate.OpenPGPComponentKey
that issued this signature.- Returns:
- issuer
-
getTargetComponent
Return theOpenPGPCertificate.OpenPGPCertificateComponent
that this signature was calculated over.- Returns:
- target
-
getTargetKeyComponent
Return theOpenPGPCertificate.OpenPGPComponentKey
that this signature is calculated over. Contrary togetTargetComponent()
, which returns the actual target, this method returns theOpenPGPCertificate.OpenPGPComponentKey
"closest" to the target. For a subkey-binding signature, this is the target subkey, while for an identity-binding signature (binding for a user-id or attribute) the return value is theOpenPGPCertificate.OpenPGPComponentKey
which carries the identity.- Returns:
- target key component of the signature
-
getKeyExpirationTime
Return the key expiration time stored in the signature.- Returns:
- key expiration time
-
verify
Verify this signature.- Parameters:
implementation
- OpenPGP implementation- Throws:
PGPSignatureException
- if the signature cannot be verified successfully
-
verify
public void verify(PGPContentVerifierBuilderProvider contentVerifierBuilderProvider, OpenPGPPolicy policy) throws PGPSignatureException Verify this signature.- Parameters:
contentVerifierBuilderProvider
- provider for verifierspolicy
- algorithm policy- Throws:
PGPSignatureException
- if the signature cannot be verified successfully
-
verifyKeySignature
protected void verifyKeySignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPComponentKey target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) throws PGPSignatureException Verify a signature of typePGPSignature.DIRECT_KEY
,PGPSignature.KEY_REVOCATION
,PGPSignature.SUBKEY_BINDING
orPGPSignature.SUBKEY_REVOCATION
.- Parameters:
issuer
- issuing component keytarget
- targeted component keycontentVerifierBuilderProvider
- provider for content verifier builders- Throws:
PGPSignatureException
- if an exception happens during signature verification
-
verifyUserIdSignature
protected void verifyUserIdSignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserId target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) throws PGPSignatureException Verify a certification signature over anOpenPGPCertificate.OpenPGPUserId
. The signature is of typePGPSignature.DEFAULT_CERTIFICATION
,PGPSignature.NO_CERTIFICATION
,PGPSignature.CASUAL_CERTIFICATION
,PGPSignature.POSITIVE_CERTIFICATION
orPGPSignature.CERTIFICATION_REVOCATION
.- Parameters:
issuer
- issuing component keytarget
- targeted useridcontentVerifierBuilderProvider
- provider for content verifier builders- Throws:
PGPSignatureException
- if an exception happens during signature verification
-
verifyUserAttributeSignature
protected void verifyUserAttributeSignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserAttribute target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) throws PGPSignatureException Verify a certification signature over anOpenPGPCertificate.OpenPGPUserAttribute
. The signature is of typePGPSignature.DEFAULT_CERTIFICATION
,PGPSignature.NO_CERTIFICATION
,PGPSignature.CASUAL_CERTIFICATION
,PGPSignature.POSITIVE_CERTIFICATION
orPGPSignature.CERTIFICATION_REVOCATION
.- Parameters:
issuer
- issuing component keytarget
- targeted useridcontentVerifierBuilderProvider
- provider for content verifier builders- Throws:
PGPSignatureException
- if an exception happens during signature verification
-
getTargetDisplay
- Specified by:
getTargetDisplay
in classOpenPGPSignature
-