public abstract class OpenPGPSignature
extends java.lang.Object
PGPSignature which tracks the verification state of the signature.| Modifier and Type | Class and Description |
|---|---|
static class |
OpenPGPSignature.OpenPGPDocumentSignature
An
OpenPGPSignature made over a binary or textual document (e.g. a message). |
static class |
OpenPGPSignature.OpenPGPSignatureSubpacket
SignatureSubpacket and the OpenPGPSignature that contains it. |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isCorrect |
protected OpenPGPCertificate.OpenPGPComponentKey |
issuer |
protected boolean |
isTested |
protected PGPSignature |
signature |
| Constructor and Description |
|---|
OpenPGPSignature(PGPSignature signature,
OpenPGPCertificate.OpenPGPComponentKey issuer)
Create an
OpenPGPSignature. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getCreationTime()
Return the creation time of the signature.
|
byte[] |
getEncoded()
Return the binary encoding of the signature.
|
byte[] |
getEncoded(PacketFormat packetFormat)
Return the binary encoding of the signature.
|
java.util.Date |
getExpirationTime()
Return the expiration time of the signature.
|
OpenPGPCertificate.OpenPGPComponentKey |
getIssuer()
Return the
OpenPGPCertificate.OpenPGPComponentKey subkey that issued this signature. |
OpenPGPCertificate |
getIssuerCertificate()
Return the
OpenPGPCertificate that contains the subkey that issued this signature. |
protected java.lang.String |
getIssuerDisplay() |
KeyIdentifier |
getKeyIdentifier()
Return the most expressive
KeyIdentifier from available candidates. |
java.util.List<KeyIdentifier> |
getKeyIdentifiers()
Return a
List of possible KeyIdentifier candidates. |
static KeyIdentifier |
getMostExpressiveIdentifier(java.util.List<KeyIdentifier> identifiers)
Return the most expressive issuer
KeyIdentifier. |
PGPSignature |
getSignature()
Return the
PGPSignature. |
protected abstract java.lang.String |
getTargetDisplay() |
protected java.lang.String |
getType() |
boolean |
isCertification()
Return true, if this signature is a certification.
|
boolean |
isEffectiveAt(java.util.Date evaluationTime)
Return true, if the signature is not a hard revocation, and if the evaluation time falls into the period
between signature creation time and expiration or revocation.
|
boolean |
isHardRevocation()
Return true, if this signature is a hard revocation.
|
boolean |
isRevocation()
Return true, if this signature is a revocation, false otherwise.
|
boolean |
isTestedCorrect()
Return true, if this signature has been tested and is correct.
|
java.lang.String |
toAsciiArmoredString()
Return an ASCII armored String representation of the signature.
|
java.lang.String |
toAsciiArmoredString(PacketFormat packetFormat)
Return an ASCII armored String representation of the signature.
|
java.lang.String |
toAsciiArmoredString(PacketFormat packetFormat,
ArmoredOutputStream.Builder armorBuilder)
Return an ASCII armored String representation of the signature.
|
java.lang.String |
toString() |
protected final PGPSignature signature
protected final OpenPGPCertificate.OpenPGPComponentKey issuer
protected boolean isTested
protected boolean isCorrect
public OpenPGPSignature(PGPSignature signature, OpenPGPCertificate.OpenPGPComponentKey issuer)
OpenPGPSignature.signature - signatureissuer - issuer subkeypublic PGPSignature getSignature()
PGPSignature.public OpenPGPCertificate.OpenPGPComponentKey getIssuer()
OpenPGPCertificate.OpenPGPComponentKey subkey that issued this signature.
This method might return null, if the issuer certificate is not available.public OpenPGPCertificate getIssuerCertificate()
OpenPGPCertificate that contains the subkey that issued this signature.
This method might return null if the issuer certificate is not availablepublic java.util.List<KeyIdentifier> getKeyIdentifiers()
List of possible KeyIdentifier candidates.public KeyIdentifier getKeyIdentifier()
KeyIdentifier from available candidates.public static KeyIdentifier getMostExpressiveIdentifier(java.util.List<KeyIdentifier> identifiers)
KeyIdentifier.
Due to historic reasons, signatures MAY contain more than one issuer packet, which might contain inconsistent
information (issuer key-ids / issuer fingerprints).
Throw wildcards (anonymous issuers) into the mix, and it becomes apparent, that there needs to be a way to
select the "best" issuer identifier.
If there are more than one issuer packet, this method returns the most expressive (prefer fingerprints over
key-ids, prefer non-wildcard over wildcard) and returns that.identifiers - list of available identifierspublic boolean isTestedCorrect()
public java.util.Date getCreationTime()
public java.util.Date getExpirationTime()
public boolean isEffectiveAt(java.util.Date evaluationTime)
evaluationTime - time for which you want to determine effectiveness of the signaturepublic boolean isHardRevocation()
public boolean isCertification()
public boolean isRevocation()
public java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String getIssuerDisplay()
protected abstract java.lang.String getTargetDisplay()
protected java.lang.String getType()
public java.lang.String toAsciiArmoredString()
throws java.io.IOException
java.io.IOException - if the signature cannot be encodedpublic java.lang.String toAsciiArmoredString(PacketFormat packetFormat) throws java.io.IOException
packetFormat - decide, which packet format to use when encoding the signaturejava.io.IOException - if the signature cannot be encodedpublic java.lang.String toAsciiArmoredString(PacketFormat packetFormat, ArmoredOutputStream.Builder armorBuilder) throws java.io.IOException
ArmoredOutputStream.Builder.packetFormat - decide, which packet format to use when encoding the signaturearmorBuilder - builder for the ASCII armored output streamjava.io.IOException - if the signature cannot be encodedpublic byte[] getEncoded()
throws java.io.IOException
java.io.IOException - if the signature cannot be encodedpublic byte[] getEncoded(PacketFormat packetFormat) throws java.io.IOException
packetFormat - decide, which packet format to use when encoding the signaturejava.io.IOException - if the signature cannot be encoded