Class OpenPGPCertificate.OpenPGPCertificateComponent
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPCertificateComponent
- Direct Known Subclasses:
OpenPGPCertificate.OpenPGPComponentKey, OpenPGPCertificate.OpenPGPIdentityComponent
- Enclosing class:
OpenPGPCertificate
Component on an OpenPGP certificate.
Components can either be
keys or identities.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn thePreferredAEADCiphersuitesthat apply to this (sub-)key.getAEADCipherSuitePreferences(Date evaluationTime) Return thePreferredAEADCiphersuitesthat - at evaluation time - apply to this (sub-)key.getApplyingSubpacket(Date evaluationTime, int subpacketType) Return theSignatureSubpacketinstance of the given subpacketType, which currently applies to the key.Return this componentsOpenPGPCertificate.Return the latest self-signature certification binding this component.getCertification(Date evaluationTime) Return the (at evaluation time) latest self certification signature binding this component.Return the compression algorithm preferences of this (sub-)key.getCompressionAlgorithmPreferences(Date evaluationTime) Return the compression algorithm preferences of this (sub-)key at evaluation time.Return theFeaturessignature subpacket that currently applies to the key.getFeatures(Date evaluationTime) Return theFeaturessignature subpacket that - at evaluation time - applies to the key.Return the current signature hash algorithm preferences of this (sub-)key.getHashAlgorithmPreferences(Date evaluationTime) Return the signature hash algorithm preferences of this (sub-)key at evaluation time.protected abstract OpenPGPCertificate.OpenPGPComponentKeyReturn theOpenPGPCertificate.OpenPGPComponentKeybelonging to thisOpenPGPCertificate.OpenPGPCertificateComponent.Return theDate, at which the key expires.getKeyExpirationDateAt(Date evaluationTime) Return theDate, at which the key - at evaluation time - expires.Return theKeyFlagssignature subpacket that currently applies to the key.getKeyFlags(Date evaluationTime) Return theKeyFlagssignature subpacket that - at evaluation time - applies to the key.Return the latest self-signature on the component.getLatestSelfSignature(Date evaluationTime) Return the (at evaluation time) latest self-signature on the component.getMergedDanglingExternalSignatureChainEndsFrom(OpenPGPCertificate thirdPartyCertificate) Find all third-partycomponent signatureson this component, which were issued by the given third-party certificate.Return the publicOpenPGPCertificate.OpenPGPCertificateComponentthat belongs to this component.Return the latest revocation signature on this component.getRevocation(Date evaluationTime) Return the (at evaluation time) latest self revocation signature revoking this component.Return all self-signature chains on components of this certificate.Return allOpenPGPCertificate.OpenPGPSignatureChainsthat bind this component.Return the current symmetric encryption algorithm preferences of this (sub-)key.getSymmetricCipherPreferences(Date evaluationTime) Return the symmetric encryption algorithm preferences of this (sub-)key at evaluation time.Return a list of all third-party-issued certifyingOpenPGPComponentSignatureson this component.Return a list of all third-party-issued revokingOpenPGPComponentSignatureson this component.getThirdPartySignatureChainsBy(OpenPGPCertificate thirdPartyCertificate) Return all third-party signature chains originating from the given certificate on this certificate.booleanhasKeyFlags(Date evaluationTime, int... flags) ReturnbooleanisBound()Return true, if the component is currently validly bound to the certificate.booleanReturn true, if this component is - at evaluation time - properly bound to its certificate.abstract StringReturn a detailed String representation of this component.
-
Constructor Details
-
OpenPGPCertificateComponent
-
-
Method Details
-
getCertificate
Return this componentsOpenPGPCertificate.- Returns:
- certificate
-
toDetailString
Return a detailed String representation of this component.- Returns:
- detailed String representation
-
isBound
public boolean isBound()Return true, if the component is currently validly bound to the certificate.- Returns:
- true if bound
-
isBoundAt
Return true, if this component is - at evaluation time - properly bound to its certificate.- Parameters:
evaluationTime- evaluation time- Returns:
- true if bound, false otherwise
-
getSignatureChains
Return allOpenPGPCertificate.OpenPGPSignatureChainsthat bind this component.- Returns:
- signature chains
-
getSelfSignatureChains
Return all self-signature chains on components of this certificate.- Returns:
- self-signature chains
-
getThirdPartySignatureChainsBy
protected OpenPGPCertificate.OpenPGPSignatureChains getThirdPartySignatureChainsBy(OpenPGPCertificate thirdPartyCertificate) Return all third-party signature chains originating from the given certificate on this certificate.- Parameters:
thirdPartyCertificate- third-party certificate- Returns:
- all signature chains over this component which originate at the given third-party certificate.
-
getCertification
Return the latest self-signature certification binding this component.- Returns:
- latest component certification signature
-
getCertification
Return the (at evaluation time) latest self certification signature binding this component.- Parameters:
evaluationTime- reference time- Returns:
- latest component certification signature
-
getRevocation
Return the latest revocation signature on this component.- Returns:
- latest revocation
-
getRevocation
Return the (at evaluation time) latest self revocation signature revoking this component.- Parameters:
evaluationTime- reference time- Returns:
- latest component revocation signature
-
getThirdPartyCertifications
Return a list of all third-party-issued certifyingOpenPGPComponentSignatureson this component.- Returns:
- all third-party issued certification signatures on this component.
-
getThirdPartyRevocations
Return a list of all third-party-issued revokingOpenPGPComponentSignatureson this component.- Returns:
- all third-party issued revocation signatures on this component.
-
getLatestSelfSignature
Return the latest self-signature on the component. That might either be a certification signature, or a revocation.- Returns:
- latest self signature
-
getLatestSelfSignature
public abstract OpenPGPCertificate.OpenPGPComponentSignature getLatestSelfSignature(Date evaluationTime) Return the (at evaluation time) latest self-signature on the component. That might either be a certification signature, or a revocation.- Parameters:
evaluationTime- reference time- Returns:
- latest self signature
-
getPublicComponent
Return the publicOpenPGPCertificate.OpenPGPCertificateComponentthat 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 inMapsthat usecomponentsas map keys.- Returns:
- public certificate component
-
getKeyComponent
Return theOpenPGPCertificate.OpenPGPComponentKeybelonging to thisOpenPGPCertificate.OpenPGPCertificateComponent. If thisOpenPGPCertificate.OpenPGPCertificateComponentis an instance ofOpenPGPCertificate.OpenPGPComponentKey, the method simply returnsthis
. If instead, theOpenPGPCertificate.OpenPGPCertificateComponentis anOpenPGPCertificate.OpenPGPIdentityComponent, the primary key it is bound to is returned. -
getKeyFlags
-
getKeyFlags
-
hasKeyFlags
Returntrue
, 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, callhasKeyFlags(evalTime, A | B)
.- Parameters:
evaluationTime- evaluation timeflags- key flags (seeKeyFlagsfor possible values)- Returns:
- true if the key has ANY of the provided flags
-
getFeatures
-
getFeatures
-
getAEADCipherSuitePreferences
Return thePreferredAEADCiphersuitesthat apply to this (sub-)key. Note: This refers to AEAD preferences as defined in rfc9580, NOT LibrePGP AEAD algorithms.- Returns:
- AEAD algorithm preferences
-
getAEADCipherSuitePreferences
Return thePreferredAEADCiphersuitesthat - at evaluation time - apply to this (sub-)key. Note: This refers to AEAD preferences as defined in rfc9580, NOT LibrePGP AEAD algorithms.- Parameters:
evaluationTime- evaluation time- Returns:
- AEAD algorithm preferences at evaluation time
-
getSymmetricCipherPreferences
Return the current symmetric encryption algorithm preferences of this (sub-)key.- Returns:
- current preferred symmetric-key algorithm preferences
-
getSymmetricCipherPreferences
Return the symmetric encryption algorithm preferences of this (sub-)key at evaluation time.- Parameters:
evaluationTime- evaluation time- Returns:
- current preferred symmetric-key algorithm preferences
-
getHashAlgorithmPreferences
Return the current signature hash algorithm preferences of this (sub-)key.- Returns:
- hash algorithm preferences
-
getHashAlgorithmPreferences
Return the signature hash algorithm preferences of this (sub-)key at evaluation time.- Parameters:
evaluationTime- evaluation time- Returns:
- hash algorithm preferences
-
getCompressionAlgorithmPreferences
Return the compression algorithm preferences of this (sub-)key.- Returns:
- compression algorithm preferences
-
getCompressionAlgorithmPreferences
Return the compression algorithm preferences of this (sub-)key at evaluation time.- Parameters:
evaluationTime- reference time- Returns:
- compression algorithm preferences
-
getKeyExpirationDate
-
getKeyExpirationDateAt
-
getApplyingSubpacket
protected OpenPGPSignature.OpenPGPSignatureSubpacket getApplyingSubpacket(Date evaluationTime, int subpacketType) Return theSignatureSubpacketinstance 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.- Parameters:
evaluationTime- evaluation timesubpacketType- subpacket type that is being searched for- Returns:
- subpacket from directly or indirectly applying signature
- See Also:
-
getMergedDanglingExternalSignatureChainEndsFrom
protected OpenPGPCertificate.OpenPGPSignatureChains getMergedDanglingExternalSignatureChainEndsFrom(OpenPGPCertificate thirdPartyCertificate) Find all third-partycomponent signatureson this component, which were issued by the given third-party certificate. Find theOpenPGPCertificate.OpenPGPSignatureChainsbinding the issuing component key and append the third-party signatures as leaf links. Return all such chains. This is a utility method for third-party signature chain evaluation.- Parameters:
thirdPartyCertificate- third-party certificate- Returns:
- dangling external signatures with issuer signature chains prepended
-