Package org.bouncycastle.openpgp.api
Class OpenPGPCertificate.OpenPGPComponentKey
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPCertificateComponent
org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPComponentKey
- Direct Known Subclasses:
OpenPGPCertificate.OpenPGPPrimaryKey
,OpenPGPCertificate.OpenPGPSubkey
,OpenPGPKey.OpenPGPSecretKey
- Enclosing class:
OpenPGPCertificate
public abstract static class OpenPGPCertificate.OpenPGPComponentKey
extends OpenPGPCertificate.OpenPGPCertificateComponent
A component key is either an
OpenPGPCertificate.OpenPGPPrimaryKey
, or an OpenPGPCertificate.OpenPGPSubkey
.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenPGPComponentKey
(PGPPublicKey rawPubkey, OpenPGPCertificate certificate) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Return the public key algorithm.Return the creation time of this key.protected OpenPGPCertificate.OpenPGPComponentKey
Return theOpenPGPCertificate.OpenPGPComponentKey
belonging to thisOpenPGPCertificate.OpenPGPCertificateComponent
.Return theKeyIdentifier
of this key.getLatestSelfSignature
(Date evaluationTime) Return the (at evaluation time) latest self-signature on the component.Return the underlyingPGPPublicKey
of thisOpenPGPCertificate.OpenPGPComponentKey
.int
Return the public key version.int
hashCode()
boolean
Return true, if the key is currently marked as certification key that can sign 3rd-party certificates.boolean
isCertificationKey
(Date evaluationTime) Return true, if the key is - at evaluation time - marked as certification key that can sign 3rd-party certificates.boolean
Return true, if the key is currently marked as encryption key.boolean
isEncryptionKey
(Date evaluationTime) Return true, if the is - at evaluation time - marked as an encryption key.abstract boolean
Return true, if thisOpenPGPCertificate.OpenPGPComponentKey
represents the primary key of anOpenPGPCertificate
.boolean
Return true, if the key is currently marked as a signing key for message signing.boolean
isSigningKey
(Date evaluationTime) Return true, if the key is - at evaluation time - marked as signing key for message signing.Methods inherited from class org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPCertificateComponent
getAEADCipherSuitePreferences, getAEADCipherSuitePreferences, getApplyingSubpacket, getCertificate, getCertification, getCompressionAlgorithmPreferences, getCompressionAlgorithmPreferences, getFeatures, getFeatures, getHashAlgorithmPreferences, getHashAlgorithmPreferences, getKeyExpirationDate, getKeyExpirationDateAt, getKeyFlags, getKeyFlags, getLatestSelfSignature, getMergedDanglingExternalSignatureChainEndsFrom, getPublicComponent, getRevocation, getSignatureChains, getSymmetricCipherPreferences, getSymmetricCipherPreferences, hasKeyFlags, isBound, isBoundAt, toDetailString
-
Field Details
-
rawPubkey
-
-
Constructor Details
-
OpenPGPComponentKey
Constructor.- Parameters:
rawPubkey
- public keycertificate
- certificate
-
-
Method Details
-
getPGPPublicKey
Return the underlyingPGPPublicKey
of thisOpenPGPCertificate.OpenPGPComponentKey
.- Returns:
- public key
-
getKeyIdentifier
Return theKeyIdentifier
of this key.- Returns:
- key identifier
-
getAlgorithm
public int getAlgorithm()Return the public key algorithm.- Returns:
- public key algorithm id
- See Also:
-
getVersion
public int getVersion()Return the public key version.- Returns:
- key version
-
getCreationTime
Return the creation time of this key.- Returns:
- creation time
-
isPrimaryKey
public abstract boolean isPrimaryKey()Return true, if thisOpenPGPCertificate.OpenPGPComponentKey
represents the primary key of anOpenPGPCertificate
.- Returns:
- true if primary, false if subkey
-
getLatestSelfSignature
Description copied from class:OpenPGPCertificate.OpenPGPCertificateComponent
Return the (at evaluation time) latest self-signature on the component. That might either be a certification signature, or a revocation.- Specified by:
getLatestSelfSignature
in classOpenPGPCertificate.OpenPGPCertificateComponent
- Parameters:
evaluationTime
- reference time- Returns:
- latest self signature
-
isEncryptionKey
public boolean isEncryptionKey()Return true, if the key is currently marked as encryption key.- Returns:
- true if the key is an encryption key, false otherwise
-
isEncryptionKey
Return true, if the is - at evaluation time - marked as an encryption key.- Parameters:
evaluationTime
- evaluation time- Returns:
- true if key is an encryption key at evaluation time, false otherwise
-
isSigningKey
public boolean isSigningKey()Return true, if the key is currently marked as a signing key for message signing.- Returns:
- true, if key is currently signing key
-
isSigningKey
Return true, if the key is - at evaluation time - marked as signing key for message signing.- Parameters:
evaluationTime
- evaluation time- Returns:
- true if key is signing key at evaluation time
-
isCertificationKey
public boolean isCertificationKey()Return true, if the key is currently marked as certification key that can sign 3rd-party certificates.- Returns:
- true, if key is certification key
-
isCertificationKey
Return true, if the key is - at evaluation time - marked as certification key that can sign 3rd-party certificates.- Parameters:
evaluationTime
- evaluation time- Returns:
- true if key is certification key at evaluation time
-
getKeyComponent
Description copied from class:OpenPGPCertificate.OpenPGPCertificateComponent
Return theOpenPGPCertificate.OpenPGPComponentKey
belonging to thisOpenPGPCertificate.OpenPGPCertificateComponent
. If thisOpenPGPCertificate.OpenPGPCertificateComponent
is an instance ofOpenPGPCertificate.OpenPGPComponentKey
, the method simply returnsthis
. If instead, theOpenPGPCertificate.OpenPGPCertificateComponent
is anOpenPGPCertificate.OpenPGPIdentityComponent
, the primary key it is bound to is returned.- Specified by:
getKeyComponent
in classOpenPGPCertificate.OpenPGPCertificateComponent
- Returns:
OpenPGPCertificate.OpenPGPComponentKey
of thisOpenPGPCertificate.OpenPGPCertificateComponent
.
-
hashCode
public int hashCode() -
equals
-