public class OpenPGPKey extends OpenPGPCertificate
OpenPGPKey (TSK - transferable secret key) is the pendant to an OpenPGPCertificate,
but containing the secret key material in addition to the public components.
It consists of one or multiple OpenPGPKey.OpenPGPSecretKey objects.| Modifier and Type | Class and Description |
|---|---|
static class |
OpenPGPKey.OpenPGPPrivateKey
Unlocked
OpenPGPKey.OpenPGPSecretKey. |
static class |
OpenPGPKey.OpenPGPSecretKey
Secret key component of a
OpenPGPCertificate.OpenPGPPrimaryKey or
OpenPGPCertificate.OpenPGPSubkey. |
OpenPGPCertificate.OpenPGPCertificateComponent, OpenPGPCertificate.OpenPGPComponentKey, OpenPGPCertificate.OpenPGPComponentSignature, OpenPGPCertificate.OpenPGPIdentityComponent, OpenPGPCertificate.OpenPGPPrimaryKey, OpenPGPCertificate.OpenPGPSignatureChain, OpenPGPCertificate.OpenPGPSignatureChains, OpenPGPCertificate.OpenPGPSubkey, OpenPGPCertificate.OpenPGPUserAttribute, OpenPGPCertificate.OpenPGPUserIdkeyRing| Constructor and Description |
|---|
OpenPGPKey(java.util.Collection<OpenPGPKey.OpenPGPSecretKey> secretKeys,
OpenPGPImplementation implementation) |
OpenPGPKey(java.util.Collection<OpenPGPKey.OpenPGPSecretKey> secretKeys,
OpenPGPImplementation implementation,
OpenPGPPolicy policy) |
OpenPGPKey(PGPSecretKeyRing keyRing)
Create an
OpenPGPKey instance based on a PGPSecretKeyRing. |
OpenPGPKey(PGPSecretKeyRing keyRing,
OpenPGPImplementation implementation)
Create an
OpenPGPKey instance based on a PGPSecretKeyRing,
a provided OpenPGPImplementation and its OpenPGPPolicy. |
OpenPGPKey(PGPSecretKeyRing keyRing,
OpenPGPImplementation implementation,
OpenPGPPolicy policy)
Create an
OpenPGPKey instance based on a PGPSecretKeyRing,
a provided OpenPGPImplementation and OpenPGPPolicy. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<OpenPGPCertificate.OpenPGPCertificateComponent> |
getComponents()
Return a
List containing all components of the certificate. |
byte[] |
getEncoded(PacketFormat packetFormat)
Return a byte array containing the binary representation of the certificate, encoded using the
given packet length encoding format.
|
PGPSecretKeyRing |
getPGPKeyRing()
Return the
PGPKeyRing that this certificate is based on. |
PGPSecretKeyRing |
getPGPSecretKeyRing()
Return the underlying
PGPSecretKeyRing. |
OpenPGPKey.OpenPGPSecretKey |
getPrimarySecretKey()
Return the
OpenPGPKey.OpenPGPSecretKey of this key's primary key. |
OpenPGPKey.OpenPGPSecretKey |
getSecretKey(KeyIdentifier identifier)
Return the
OpenPGPKey.OpenPGPSecretKey identified by the passed KeyIdentifier. |
OpenPGPKey.OpenPGPSecretKey |
getSecretKey(OpenPGPCertificate.OpenPGPComponentKey key)
Return the
OpenPGPKey.OpenPGPSecretKey that corresponds to the passed OpenPGPComponentKey. |
java.util.Map<KeyIdentifier,OpenPGPKey.OpenPGPSecretKey> |
getSecretKeys()
Return a
Map containing all OpenPGPKey.OpenPGPSecretKey components (secret subkeys) of the key. |
boolean |
isSecretKey()
Return true, if this object is an
OpenPGPKey, false otherwise. |
OpenPGPCertificate |
toCertificate()
Return the
OpenPGPCertificate of this OpenPGPKey. |
getAllKeyIdentifiers, getAllThirdPartyKeySignatures, getAllUserIds, getCertification, getCertification, getCertificationKeys, getCertificationKeys, getComponentKeysWithFlag, getDelegationBy, getDelegationBy, getDelegationsBy, getEncoded, getEncryptionKeys, getEncryptionKeys, getEncryptionKeys, getExpirationTime, getExpirationTime, getFingerprint, getIdentities, getKey, getKeyIdentifier, getKeys, getLastModificationDate, getLastModificationDateAt, getPGPPublicKeyRing, getPrettyFingerprint, getPrimaryKey, getPrimaryUserId, getPrimaryUserId, getPublicKeys, getRevocation, getRevocation, getRevocationBy, getRevocationBy, getRevocationsBy, getSigningKeyFor, getSigningKeys, getSigningKeys, getSubkeys, getUserId, getValidKeys, getValidKeys, getValidUserIds, getValidUserIds, join, join, toAsciiArmoredString, toAsciiArmoredString, toAsciiArmoredStringpublic OpenPGPKey(PGPSecretKeyRing keyRing)
OpenPGPKey instance based on a PGPSecretKeyRing.
The OpenPGPImplementation will be acquired by invoking OpenPGPImplementation.getInstance().keyRing - secret key ringpublic OpenPGPKey(PGPSecretKeyRing keyRing, OpenPGPImplementation implementation)
OpenPGPKey instance based on a PGPSecretKeyRing,
a provided OpenPGPImplementation and its OpenPGPPolicy.keyRing - secret key ringimplementation - OpenPGP implementationpublic OpenPGPKey(java.util.Collection<OpenPGPKey.OpenPGPSecretKey> secretKeys, OpenPGPImplementation implementation)
public OpenPGPKey(java.util.Collection<OpenPGPKey.OpenPGPSecretKey> secretKeys, OpenPGPImplementation implementation, OpenPGPPolicy policy)
public OpenPGPKey(PGPSecretKeyRing keyRing, OpenPGPImplementation implementation, OpenPGPPolicy policy)
OpenPGPKey instance based on a PGPSecretKeyRing,
a provided OpenPGPImplementation and OpenPGPPolicy.keyRing - secret key ringimplementation - OpenPGP implementationpolicy - OpenPGP policypublic boolean isSecretKey()
OpenPGPCertificateOpenPGPKey, false otherwise.isSecretKey in class OpenPGPCertificatepublic OpenPGPCertificate toCertificate()
OpenPGPCertificate of this OpenPGPKey.public java.util.List<OpenPGPCertificate.OpenPGPCertificateComponent> getComponents()
OpenPGPCertificateList containing all components of the certificate.
Components are primary key, subkeys and identities (user-ids, user attributes).getComponents in class OpenPGPCertificatepublic OpenPGPKey.OpenPGPSecretKey getPrimarySecretKey()
OpenPGPKey.OpenPGPSecretKey of this key's primary key.public java.util.Map<KeyIdentifier,OpenPGPKey.OpenPGPSecretKey> getSecretKeys()
Map containing all OpenPGPKey.OpenPGPSecretKey components (secret subkeys) of the key.public OpenPGPKey.OpenPGPSecretKey getSecretKey(KeyIdentifier identifier)
OpenPGPKey.OpenPGPSecretKey identified by the passed KeyIdentifier.identifier - key identifierpublic OpenPGPKey.OpenPGPSecretKey getSecretKey(OpenPGPCertificate.OpenPGPComponentKey key)
OpenPGPKey.OpenPGPSecretKey that corresponds to the passed OpenPGPComponentKey.key - component keypublic PGPSecretKeyRing getPGPKeyRing()
OpenPGPCertificatePGPKeyRing that this certificate is based on.getPGPKeyRing in class OpenPGPCertificatepublic PGPSecretKeyRing getPGPSecretKeyRing()
PGPSecretKeyRing.public byte[] getEncoded(PacketFormat packetFormat) throws java.io.IOException
OpenPGPCertificategetEncoded in class OpenPGPCertificatepacketFormat - packet length encoding formatjava.io.IOException - if the certificate cannot be encoded