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 OpenPGPSignature
OpenPGPSignature.OpenPGPDocumentSignature, OpenPGPSignature.OpenPGPSignatureSubpacket -
Field Summary
Fields inherited from class OpenPGPSignature
isCorrect, issuer, isTested, signature -
Constructor Summary
ConstructorsConstructorDescriptionOpenPGPComponentSignature(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPCertificateComponent target) Component signature. -
Method Summary
Modifier and TypeMethodDescriptionReturn theOpenPGPCertificate.OpenPGPComponentKeythat issued this signature.Return the key expiration time stored in the signature.Return theOpenPGPCertificate.OpenPGPCertificateComponentthat this signature was calculated over.protected StringReturn theOpenPGPCertificate.OpenPGPComponentKeythat this signature is calculated over.voidverify(OpenPGPImplementation implementation) Verify this signature.voidverify(PGPContentVerifierBuilderProvider contentVerifierBuilderProvider, OpenPGPPolicy policy) Verify this signature.protected voidverifyKeySignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPComponentKey target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a signature of typePGPSignature.DIRECT_KEY,PGPSignature.KEY_REVOCATION,PGPSignature.SUBKEY_BINDINGorPGPSignature.SUBKEY_REVOCATION.protected voidverifyUserAttributeSignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserAttribute target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a certification signature over anOpenPGPCertificate.OpenPGPUserAttribute.protected voidverifyUserIdSignature(OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPCertificate.OpenPGPUserId target, PGPContentVerifierBuilderProvider contentVerifierBuilderProvider) Verify a certification signature over anOpenPGPCertificate.OpenPGPUserId.Methods inherited from class OpenPGPSignature
getCreationTime, getEncoded, getEncoded, getExpirationTime, getIssuer, getIssuerCertificate, getIssuerDisplay, getKeyIdentifier, getKeyIdentifiers, getMostExpressiveIdentifier, getSignature, getType, isCertification, isEffectiveAt, isHardRevocation, isRevocation, isTestedCorrect, toAsciiArmoredString, toAsciiArmoredString, 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.OpenPGPComponentKeythat issued this signature.- Returns:
- issuer
-
getTargetComponent
Return theOpenPGPCertificate.OpenPGPCertificateComponentthat this signature was calculated over.- Returns:
- target
-
getTargetKeyComponent
Return theOpenPGPCertificate.OpenPGPComponentKeythat 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.OpenPGPComponentKeywhich 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_BINDINGorPGPSignature.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_CERTIFICATIONorPGPSignature.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_CERTIFICATIONorPGPSignature.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:
getTargetDisplayin classOpenPGPSignature
-