public static class OpenPGPSignature.OpenPGPDocumentSignature extends OpenPGPSignature
OpenPGPSignature made over a binary or textual document (e.g. a message).
Also known as a Data Signature.
An OpenPGPSignature.OpenPGPDocumentSignature CANNOT live on a OpenPGPCertificate.OpenPGPSignature.OpenPGPDocumentSignature, OpenPGPSignature.OpenPGPSignatureSubpacket| Modifier and Type | Field and Description |
|---|---|
protected OpenPGPSignature.OpenPGPDocumentSignature |
attestedSignature |
isCorrect, issuer, isTested, signature| Constructor and Description |
|---|
OpenPGPDocumentSignature(PGPSignature signature,
OpenPGPCertificate.OpenPGPComponentKey issuer)
Create a document signature of level 0 (signature is made directly over the document).
|
OpenPGPDocumentSignature(PGPSignature signature,
OpenPGPCertificate.OpenPGPComponentKey issuer,
OpenPGPSignature.OpenPGPDocumentSignature attestedSignature)
Create a document signature of level greater than 0 (signature is made as an attestation over
other signature(s) + document).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createdInBounds(java.util.Date notBefore,
java.util.Date notAfter)
Check, if the creation time of the signature is within the interval
notBefore <= creationTime <= notAfter
|
OpenPGPSignature.OpenPGPDocumentSignature |
getAttestedSignature()
Return the attested signature (or null if this is not an attestation signature).
|
int |
getSignatureLevel()
Return the signature attestation level of this signature.
|
protected java.lang.String |
getTargetDisplay() |
boolean |
isValid()
Return true, if the signature is valid at this moment.
|
boolean |
isValid(OpenPGPPolicy policy)
Return true, if the signature is valid at this moment using the given policy.
|
boolean |
isValidAt(java.util.Date date)
Return true, if th signature is valid at the given date.
|
boolean |
isValidAt(java.util.Date date,
OpenPGPPolicy policy)
Return true, if th signature is valid at the given date using the given policy.
|
boolean |
verify()
Verify the correctness of a prefixed-signature.
|
boolean |
verify(PGPOnePassSignature ops)
Verify the correctness of an inline signature by evaluating the corresponding
PGPOnePassSignature. |
getCreationTime, getEncoded, getEncoded, getExpirationTime, getIssuer, getIssuerCertificate, getIssuerDisplay, getKeyIdentifier, getKeyIdentifiers, getMostExpressiveIdentifier, getSignature, getType, isCertification, isEffectiveAt, isHardRevocation, isRevocation, isTestedCorrect, toAsciiArmoredString, toAsciiArmoredString, toAsciiArmoredString, toStringprotected final OpenPGPSignature.OpenPGPDocumentSignature attestedSignature
public OpenPGPDocumentSignature(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer)
signature - signatureissuer - public issuer-signing-key-component (or null if not available)public OpenPGPDocumentSignature(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer, OpenPGPSignature.OpenPGPDocumentSignature attestedSignature)
signature - attestation signatureissuer - public issuer signing-key-component (or null if not available)attestedSignature - the attested signatureprotected java.lang.String getTargetDisplay()
getTargetDisplay in class OpenPGPSignaturepublic int getSignatureLevel()
public OpenPGPSignature.OpenPGPDocumentSignature getAttestedSignature()
public boolean verify(PGPOnePassSignature ops) throws PGPException
PGPOnePassSignature.ops - one-pass-signature packetPGPException - if the signature cannot be verifiedpublic boolean verify()
throws PGPException
PGPException - if the signature cannot be verifiedpublic boolean isValid()
throws PGPSignatureException
PGPSignatureExceptionpublic boolean isValid(OpenPGPPolicy policy) throws PGPSignatureException
policy - policyPGPSignatureExceptionpublic boolean isValidAt(java.util.Date date)
throws PGPSignatureException
date - evaluation timejava.lang.IllegalStateException - if the signature has not yet been tested using a verify()method.
PGPSignatureExceptionpublic boolean isValidAt(java.util.Date date,
OpenPGPPolicy policy)
throws PGPSignatureException
date - evaluation timepolicy - policyjava.lang.IllegalStateException - if the signature has not yet been tested using a verify()method.
PGPSignatureExceptionpublic boolean createdInBounds(java.util.Date notBefore,
java.util.Date notAfter)
notBefore <= creationTime <= notAfter
notBefore - earliest accepted creation timenotAfter - latest accepted creation time