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 TypeMethodDescriptionbooleanintReturn the public key algorithm.Return the creation time of this key.protected OpenPGPCertificate.OpenPGPComponentKeyReturn theOpenPGPCertificate.OpenPGPComponentKeybelonging to thisOpenPGPCertificate.OpenPGPCertificateComponent.Return theKeyIdentifierof this key.getLatestSelfSignature(Date evaluationTime) Return the (at evaluation time) latest self-signature on the component.Return the underlyingPGPPublicKeyof thisOpenPGPCertificate.OpenPGPComponentKey.intReturn the public key version.inthashCode()booleanReturn true, if the key is currently marked as certification key that can sign 3rd-party certificates.booleanisCertificationKey(Date evaluationTime) Return true, if the key is - at evaluation time - marked as certification key that can sign 3rd-party certificates.booleanReturn true, if the key is currently marked as encryption key.booleanisEncryptionKey(Date evaluationTime) Return true, if the is - at evaluation time - marked as an encryption key.abstract booleanReturn true, if thisOpenPGPCertificate.OpenPGPComponentKeyrepresents the primary key of anOpenPGPCertificate.booleanReturn true, if the key is currently marked as a signing key for message signing.booleanisSigningKey(Date evaluationTime) Return true, if the key is - at evaluation time - marked as signing key for message signing.Methods inherited from class 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 underlyingPGPPublicKeyof thisOpenPGPCertificate.OpenPGPComponentKey.- Returns:
- public key
-
getKeyIdentifier
Return theKeyIdentifierof 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
-
isPrimaryKey
public abstract boolean isPrimaryKey()Return true, if thisOpenPGPCertificate.OpenPGPComponentKeyrepresents the primary key of anOpenPGPCertificate.- Returns:
- true if primary, false if subkey
-
getLatestSelfSignature
Description copied from class:OpenPGPCertificate.OpenPGPCertificateComponentReturn the (at evaluation time) latest self-signature on the component. That might either be a certification signature, or a revocation.- Specified by:
getLatestSelfSignaturein 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.OpenPGPCertificateComponentReturn 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.- Specified by:
getKeyComponentin classOpenPGPCertificate.OpenPGPCertificateComponent- Returns:
OpenPGPCertificate.OpenPGPComponentKeyof thisOpenPGPCertificate.OpenPGPCertificateComponent.
-
hashCode
-
equals
-