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 a 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.
Another example is a third-party certification over a user-id or certificates primary key. Here, the chain
originates from the certifiers primary key and ends at the user-id or primary key of the signee.
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.
Example:
v-----------\
[PRIMARY KEY 0xAAAA] \
/ \ \ |
/ \ \__(DIRECT KEY SIG #0)
(USERID BINDING #1) |
| (SUBKEY BINDING #2)
v |
[USERID Alice] v
[SUBKEY 0xAABB]
Here, the certificates components are bound like follows:
0xAAAA: [0xAAAA->#0->0xAAAA]Alice: [0xAAAA->#0->#1->Alice]0xAABB: [0xAAAA->#0->#2->0xAABB]In Web-of-Trust scenarios, signature chains can span multiple certificates.
Example:
________________
v |
[PRIMARY KEY 0xAAAA]---(DIRECT KEY SIG #0)
/ | \
(USERID BINDING #1) | \
| | (DELEGATION #2)-->[PRIMARY KEY 0xBBBB]
| \ |
v \ (USERID BINDING #3)
[USERID Alice] (CERTIFICATION #4) |
\ v
\________________>[USERID Bob]
Here, Alice delegated trust to Bob by issuing a direct key delegation signature (#0)
over Bobs primary key, as well as a 3rd-party certification signature for UserID Bob.
Now there are the following paths of trust from Alice's certificate down to Bobs certificate:
0xBBBB): [0xAAAA->#0->#2->0xBBBBBob: [0xAAAA->#0->#4->Bob0xAAAA holds signatures #0,#1, while
certificate 0xBBBB holds signatures #2,#3,#4.| 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.Objectpublic 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>