public static class OpenPGPCertificate.OpenPGPSignatureChain extends java.lang.Object implements java.lang.Comparable<OpenPGPCertificate.OpenPGPSignatureChain>, java.lang.Iterable<OpenPGPCertificate.OpenPGPSignatureChain.Link>
signatures
.
Such a chain originates from a certificates primary key and points towards some certificate component that
is bound to the certificate.
As for example a subkey can only be bound by a primary key that holds either at least one
direct-key self-signature or at least one user-id binding signature, multiple signatures may form
a validity chain.
An OpenPGPCertificate.OpenPGPSignatureChain
can either be a certification
(isCertification()
), e.g. it represents a positive binding,
or it can be a revocation (isRevocation()
) which invalidates a positive binding.Modifier and Type | Class and Description |
---|---|
static class |
OpenPGPCertificate.OpenPGPSignatureChain.Certification
"Positive" signature chain link.
|
static class |
OpenPGPCertificate.OpenPGPSignatureChain.Link
Link in a
OpenPGPCertificate.OpenPGPSignatureChain . |
static class |
OpenPGPCertificate.OpenPGPSignatureChain.Revocation
"Negative" signature chain link.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(OpenPGPCertificate.OpenPGPSignatureChain other) |
static OpenPGPCertificate.OpenPGPSignatureChain |
direct(OpenPGPCertificate.OpenPGPComponentSignature sig)
Factory method for creating an
OpenPGPCertificate.OpenPGPSignatureChain with only a single link. |
OpenPGPCertificate.OpenPGPSignatureChain.Link |
getLeafLink()
Return the last link in the chain, which applies to the chains target component.
|
OpenPGPCertificate.OpenPGPComponentKey |
getLeafLinkTargetKey()
Return the
OpenPGPCertificate.OpenPGPComponentKey to which the leaf link applies to. |
OpenPGPCertificate.OpenPGPComponentSignature |
getRevocation()
Return the first revocation signature in the chain, or null if the chain does not contain any revocations.
|
OpenPGPCertificate.OpenPGPSignatureChain.Link |
getRootLink()
Return the very first link in the chain.
|
OpenPGPCertificate.OpenPGPComponentKey |
getRootLinkIssuer()
Return the issuer of the root link.
|
OpenPGPCertificate.OpenPGPComponentSignature |
getSignature()
Return the signature from the leaf of the chain, which directly applies to the
OpenPGPCertificate.OpenPGPCertificateComponent . |
java.util.List<OpenPGPCertificate.OpenPGPComponentSignature> |
getSignatures()
Return a List of all signatures in the chain.
|
java.util.Date |
getSince()
Return the date since which this signature chain is valid.
|
java.util.Date |
getUntil()
Return the date until which the chain link is valid.
|
boolean |
isCertification()
Return true, if the chain only consists of non-revocation signatures and is therefore a certification chain.
|
boolean |
isEffectiveAt(java.util.Date evaluationDate)
Return true if the chain is effective at the given evaluation date, meaning all link signatures have
been created before the evaluation time, and none signature expires before the evaluation time.
|
boolean |
isHardRevocation()
Return true, if the chain contains at least one link that represents a hard revocation.
|
boolean |
isRevocation()
Return true, if the chain contains at least one revocation signature.
|
boolean |
isValid()
Return true if the signature chain is valid, meaning all its chain links are valid.
|
boolean |
isValid(PGPContentVerifierBuilderProvider contentVerifierBuilderProvider,
OpenPGPPolicy policy)
Return true if the signature chain is valid, meaning all its chain links are valid.
|
java.util.Iterator<OpenPGPCertificate.OpenPGPSignatureChain.Link> |
iterator() |
OpenPGPCertificate.OpenPGPSignatureChain |
plus(OpenPGPCertificate.OpenPGPComponentSignature sig)
Return an NEW instance of the
OpenPGPCertificate.OpenPGPSignatureChain with the new link appended. |
java.lang.String |
toString() |
public OpenPGPCertificate.OpenPGPComponentSignature getSignature()
OpenPGPCertificate.OpenPGPCertificateComponent
.public OpenPGPCertificate.OpenPGPComponentSignature getRevocation()
public java.util.List<OpenPGPCertificate.OpenPGPComponentSignature> getSignatures()
public OpenPGPCertificate.OpenPGPSignatureChain plus(OpenPGPCertificate.OpenPGPComponentSignature sig)
OpenPGPCertificate.OpenPGPSignatureChain
with the new link appended.sig
- signaturepublic static OpenPGPCertificate.OpenPGPSignatureChain direct(OpenPGPCertificate.OpenPGPComponentSignature sig)
OpenPGPCertificate.OpenPGPSignatureChain
with only a single link.sig
- signaturepublic OpenPGPCertificate.OpenPGPSignatureChain.Link getRootLink()
public OpenPGPCertificate.OpenPGPComponentKey getRootLinkIssuer()
public OpenPGPCertificate.OpenPGPSignatureChain.Link getLeafLink()
public OpenPGPCertificate.OpenPGPComponentKey getLeafLinkTargetKey()
OpenPGPCertificate.OpenPGPComponentKey
to which the leaf link applies to.
For subkey binding signatures, this is the subkey.
For user-id certification signatures, it is the primary key.public boolean isCertification()
public boolean isRevocation()
public boolean isHardRevocation()
public java.util.Date getSince()
public java.util.Date getUntil()
public boolean isEffectiveAt(java.util.Date evaluationDate)
evaluationDate
- reference timepublic boolean isValid() throws PGPSignatureException
PGPSignatureException
- if an exception occurs during signature verificationpublic boolean isValid(PGPContentVerifierBuilderProvider contentVerifierBuilderProvider, OpenPGPPolicy policy) throws PGPSignatureException
contentVerifierBuilderProvider
- provider for content verifier builderspolicy
- algorithm policyPGPSignatureException
- if an exception occurs during signature verificationpublic java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(OpenPGPCertificate.OpenPGPSignatureChain other)
compareTo
in interface java.lang.Comparable<OpenPGPCertificate.OpenPGPSignatureChain>
public java.util.Iterator<OpenPGPCertificate.OpenPGPSignatureChain.Link> iterator()
iterator
in interface java.lang.Iterable<OpenPGPCertificate.OpenPGPSignatureChain.Link>