public abstract static class OpenPGPCertificate.OpenPGPCertificateComponent
extends java.lang.Object
keys
or identities
.Constructor and Description |
---|
OpenPGPCertificateComponent(OpenPGPCertificate certificate) |
Modifier and Type | Method and Description |
---|---|
PreferredAEADCiphersuites |
getAEADCipherSuitePreferences()
Return the
PreferredAEADCiphersuites that apply to this (sub-)key. |
PreferredAEADCiphersuites |
getAEADCipherSuitePreferences(java.util.Date evaluationTime)
Return the
PreferredAEADCiphersuites that - at evaluation time - apply to this (sub-)key. |
protected OpenPGPSignature.OpenPGPSignatureSubpacket |
getApplyingSubpacket(java.util.Date evaluationTime,
int subpacketType)
Return the
SignatureSubpacket instance of the given subpacketType, which currently applies to
the key. |
OpenPGPCertificate |
getCertificate()
Return this components
OpenPGPCertificate . |
OpenPGPCertificate.OpenPGPComponentSignature |
getCertification(java.util.Date evaluationTime)
Return the (at evaluation time) latest certification signature binding this component.
|
PreferredAlgorithms |
getCompressionAlgorithmPreferences()
Return the compression algorithm preferences of this (sub-)key.
|
PreferredAlgorithms |
getCompressionAlgorithmPreferences(java.util.Date evaluationTime)
Return the compression algorithm preferences of this (sub-)key at evaluation time.
|
Features |
getFeatures()
Return the
Features signature subpacket that currently applies to the key. |
Features |
getFeatures(java.util.Date evaluationTime)
Return the
Features signature subpacket that - at evaluation time - applies to the key. |
PreferredAlgorithms |
getHashAlgorithmPreferences()
Return the current signature hash algorithm preferences of this (sub-)key.
|
PreferredAlgorithms |
getHashAlgorithmPreferences(java.util.Date evaluationTime)
Return the signature hash algorithm preferences of this (sub-)key at evaluation time.
|
protected abstract OpenPGPCertificate.OpenPGPComponentKey |
getKeyComponent()
Return the
OpenPGPCertificate.OpenPGPComponentKey belonging to this OpenPGPCertificate.OpenPGPCertificateComponent . |
java.util.Date |
getKeyExpirationDate()
Return the
Date , at which the key expires. |
java.util.Date |
getKeyExpirationDateAt(java.util.Date evaluationTime)
Return the
Date , at which the key - at evaluation time - expires. |
KeyFlags |
getKeyFlags()
Return the
KeyFlags signature subpacket that currently applies to the key. |
KeyFlags |
getKeyFlags(java.util.Date evaluationTime)
Return the
KeyFlags signature subpacket that - at evaluation time - applies to the key. |
OpenPGPCertificate.OpenPGPComponentSignature |
getLatestSelfSignature()
Return the latest self-signature on the component.
|
abstract OpenPGPCertificate.OpenPGPComponentSignature |
getLatestSelfSignature(java.util.Date evaluationTime)
Return the (at evaluation time) latest self-signature on the component.
|
protected OpenPGPCertificate.OpenPGPSignatureChains |
getMergedDanglingExternalSignatureChainEndsFrom(OpenPGPCertificate thirdPartyCertificate,
java.util.Date evaluationTime)
Iterate over signatures issued over this component by the given 3rd-party certificate,
merge them with the (at evaluation time) valid self-certification chain and return the
results.
|
protected OpenPGPCertificate.OpenPGPCertificateComponent |
getPublicComponent()
Return the public
OpenPGPCertificate.OpenPGPCertificateComponent that belongs to this component. |
OpenPGPCertificate.OpenPGPComponentSignature |
getRevocation(java.util.Date evaluationTime)
Return the (at evaluation time) latest revocation signature revoking this component.
|
OpenPGPCertificate.OpenPGPSignatureChains |
getSignatureChains()
Return all
OpenPGPCertificate.OpenPGPSignatureChains that bind this component. |
PreferredAlgorithms |
getSymmetricCipherPreferences()
Return the current symmetric encryption algorithm preferences of this (sub-)key.
|
PreferredAlgorithms |
getSymmetricCipherPreferences(java.util.Date evaluationTime)
Return the symmetric encryption algorithm preferences of this (sub-)key at evaluation time.
|
boolean |
hasKeyFlags(java.util.Date evaluationTime,
int... flags)
Return true, if the key has any of the given key flags.
|
boolean |
isBound()
Return true, if the component is currently validly bound to the certificate.
|
boolean |
isBoundAt(java.util.Date evaluationTime)
Return true, if this component is - at evaluation time - properly bound to its certificate.
|
abstract java.lang.String |
toDetailString()
Return a detailed String representation of this component.
|
public OpenPGPCertificateComponent(OpenPGPCertificate certificate)
public OpenPGPCertificate getCertificate()
OpenPGPCertificate
.public abstract java.lang.String toDetailString()
public boolean isBound()
public boolean isBoundAt(java.util.Date evaluationTime)
evaluationTime
- evaluation timepublic OpenPGPCertificate.OpenPGPSignatureChains getSignatureChains()
OpenPGPCertificate.OpenPGPSignatureChains
that bind this component.public OpenPGPCertificate.OpenPGPComponentSignature getCertification(java.util.Date evaluationTime)
evaluationTime
- reference timepublic OpenPGPCertificate.OpenPGPComponentSignature getRevocation(java.util.Date evaluationTime)
evaluationTime
- reference timepublic OpenPGPCertificate.OpenPGPComponentSignature getLatestSelfSignature()
public abstract OpenPGPCertificate.OpenPGPComponentSignature getLatestSelfSignature(java.util.Date evaluationTime)
evaluationTime
- reference timeprotected OpenPGPCertificate.OpenPGPCertificateComponent getPublicComponent()
OpenPGPCertificate.OpenPGPCertificateComponent
that belongs to this component.
For public components (pubkeys, identities...), that's simply this, while secret components
return their corresponding public component.
This is used to properly map secret key and public key components in Maps
that use
components
as map keys.protected abstract OpenPGPCertificate.OpenPGPComponentKey getKeyComponent()
OpenPGPCertificate.OpenPGPComponentKey
belonging to this OpenPGPCertificate.OpenPGPCertificateComponent
.
If this OpenPGPCertificate.OpenPGPCertificateComponent
is an instance of OpenPGPCertificate.OpenPGPComponentKey
,
the method simply returns this. If instead, the
OpenPGPCertificate.OpenPGPCertificateComponent
is an OpenPGPCertificate.OpenPGPIdentityComponent
,
the primary key it is bound to is returned.public KeyFlags getKeyFlags()
KeyFlags
signature subpacket that currently applies to the key.public KeyFlags getKeyFlags(java.util.Date evaluationTime)
KeyFlags
signature subpacket that - at evaluation time - applies to the key.evaluationTime
- evaluation timepublic boolean hasKeyFlags(java.util.Date evaluationTime, int... flags)
true, if the key has any of the given key flags.
Note: To check if the key has EITHER flag A or B, call
hasKeyFlags(evalTime, A, B). To instead check, if the key has BOTH flags A AND B, call
hasKeyFlags(evalTime, A & B).
evaluationTime
- evaluation timeflags
- key flags (see KeyFlags
for possible values)public Features getFeatures()
Features
signature subpacket that currently applies to the key.public Features getFeatures(java.util.Date evaluationTime)
Features
signature subpacket that - at evaluation time - applies to the key.evaluationTime
- evaluation timepublic PreferredAEADCiphersuites getAEADCipherSuitePreferences()
PreferredAEADCiphersuites
that apply to this (sub-)key.
Note: This refers to AEAD preferences as defined in rfc9580, NOT LibrePGP AEAD algorithms.public PreferredAEADCiphersuites getAEADCipherSuitePreferences(java.util.Date evaluationTime)
PreferredAEADCiphersuites
that - at evaluation time - apply to this (sub-)key.
Note: This refers to AEAD preferences as defined in rfc9580, NOT LibrePGP AEAD algorithms.evaluationTime
- evaluation timepublic PreferredAlgorithms getSymmetricCipherPreferences()
public PreferredAlgorithms getSymmetricCipherPreferences(java.util.Date evaluationTime)
evaluationTime
- evaluation timepublic PreferredAlgorithms getHashAlgorithmPreferences()
public PreferredAlgorithms getHashAlgorithmPreferences(java.util.Date evaluationTime)
evaluationTime
- evaluation timepublic PreferredAlgorithms getCompressionAlgorithmPreferences()
public PreferredAlgorithms getCompressionAlgorithmPreferences(java.util.Date evaluationTime)
evaluationTime
- reference timepublic java.util.Date getKeyExpirationDate()
Date
, at which the key expires.public java.util.Date getKeyExpirationDateAt(java.util.Date evaluationTime)
Date
, at which the key - at evaluation time - expires.evaluationTime
- evaluation timeprotected OpenPGPSignature.OpenPGPSignatureSubpacket getApplyingSubpacket(java.util.Date evaluationTime, int subpacketType)
SignatureSubpacket
instance of the given subpacketType, which currently applies to
the key. Since subpackets from the Direct-Key signature apply to all subkeys of a certificate,
this method first inspects the signature that immediately applies to this key (e.g. a subkey-binding
signature), and - if the queried subpacket is found in there, returns that instance.
Otherwise, indirectly applying signatures (e.g. Direct-Key signatures) are queried.
That way, preferences from the direct-key signature are considered, but per-key overwrites take precedence.evaluationTime
- evaluation timesubpacketType
- subpacket type that is being searched forprotected OpenPGPCertificate.OpenPGPSignatureChains getMergedDanglingExternalSignatureChainEndsFrom(OpenPGPCertificate thirdPartyCertificate, java.util.Date evaluationTime)
thirdPartyCertificate
- certificate of a 3rd partyevaluationTime
- reference time