public static class OpenPGPKey.OpenPGPSecretKey extends OpenPGPCertificate.OpenPGPComponentKey
OpenPGPCertificate.OpenPGPPrimaryKey or
OpenPGPCertificate.OpenPGPSubkey.rawPubkey| Constructor and Description |
|---|
OpenPGPSecretKey(OpenPGPCertificate.OpenPGPComponentKey pubKey,
PGPSecretKey secKey,
PBESecretKeyDecryptorBuilderProvider decryptorBuilderProvider)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
OpenPGPCertificate.OpenPGPComponentSignature |
getLatestSelfSignature(java.util.Date evaluationTime)
Return the (at evaluation time) latest self-signature on the component.
|
OpenPGPKey |
getOpenPGPKey()
Return the
OpenPGPKey which this OpenPGPKey.OpenPGPSecretKey belongs to. |
PGPSecretKey |
getPGPSecretKey()
Return the underlying
PGPSecretKey. |
protected OpenPGPCertificate.OpenPGPCertificateComponent |
getPublicComponent()
Return the public
OpenPGPCertificate.OpenPGPCertificateComponent that belongs to this component. |
OpenPGPCertificate.OpenPGPComponentKey |
getPublicKey()
Return the public
OpenPGPComponentKey corresponding to this OpenPGPKey.OpenPGPSecretKey. |
boolean |
isLocked()
If true, the secret key is not available in plain and likely needs to be decrypted by providing
a key passphrase.
|
boolean |
isPassphraseCorrect(char[] passphrase)
Return true if the provided passphrase is correct.
|
boolean |
isPrimaryKey()
Return true, if this
OpenPGPCertificate.OpenPGPComponentKey represents the primary key of an OpenPGPCertificate. |
java.lang.String |
toDetailString()
Return a detailed String representation of this component.
|
OpenPGPKey.OpenPGPPrivateKey |
unlock()
Unlock an unprotected
OpenPGPKey.OpenPGPSecretKey. |
OpenPGPKey.OpenPGPPrivateKey |
unlock(char[] passphrase)
Access the
PGPKeyPair by unlocking the potentially locked secret key using the provided
passphrase. |
OpenPGPKey.OpenPGPPrivateKey |
unlock(KeyPassphraseProvider passphraseProvider)
Unlock a protected
OpenPGPKey.OpenPGPSecretKey. |
equals, getAlgorithm, getCreationTime, getKeyComponent, getKeyIdentifier, getPGPPublicKey, getVersion, hashCode, isCertificationKey, isCertificationKey, isEncryptionKey, isEncryptionKey, isEncryptionKey, isSigningKey, isSigningKeygetAEADCipherSuitePreferences, getAEADCipherSuitePreferences, getApplyingSubpacket, getCertificate, getCertification, getCertification, getCompressionAlgorithmPreferences, getCompressionAlgorithmPreferences, getFeatures, getFeatures, getHashAlgorithmPreferences, getHashAlgorithmPreferences, getKeyExpirationDate, getKeyExpirationDateAt, getKeyFlags, getKeyFlags, getLatestSelfSignature, getMergedDanglingExternalSignatureChainEndsFrom, getRevocation, getRevocation, getSelfSignatureChains, getSignatureChains, getSymmetricCipherPreferences, getSymmetricCipherPreferences, getThirdPartyCertifications, getThirdPartyRevocations, getThirdPartySignatureChainsBy, hasKeyFlags, isBound, isBoundAtpublic OpenPGPSecretKey(OpenPGPCertificate.OpenPGPComponentKey pubKey, PGPSecretKey secKey, PBESecretKeyDecryptorBuilderProvider decryptorBuilderProvider)
pubKey - corresponding public key componentsecKey - secret keydecryptorBuilderProvider - for unlocking private keysprotected OpenPGPCertificate.OpenPGPCertificateComponent getPublicComponent()
OpenPGPCertificate.OpenPGPCertificateComponentOpenPGPCertificate.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.getPublicComponent in class OpenPGPCertificate.OpenPGPCertificateComponentpublic boolean isPrimaryKey()
OpenPGPCertificate.OpenPGPComponentKeyOpenPGPCertificate.OpenPGPComponentKey represents the primary key of an OpenPGPCertificate.isPrimaryKey in class OpenPGPCertificate.OpenPGPComponentKeypublic OpenPGPCertificate.OpenPGPComponentSignature getLatestSelfSignature(java.util.Date evaluationTime)
OpenPGPCertificate.OpenPGPCertificateComponentgetLatestSelfSignature in class OpenPGPCertificate.OpenPGPComponentKeyevaluationTime - reference timepublic OpenPGPKey getOpenPGPKey()
OpenPGPKey which this OpenPGPKey.OpenPGPSecretKey belongs to.public java.lang.String toDetailString()
OpenPGPCertificate.OpenPGPCertificateComponenttoDetailString in class OpenPGPCertificate.OpenPGPCertificateComponentpublic PGPSecretKey getPGPSecretKey()
PGPSecretKey.public OpenPGPCertificate.OpenPGPComponentKey getPublicKey()
OpenPGPComponentKey corresponding to this OpenPGPKey.OpenPGPSecretKey.public boolean isLocked()
public OpenPGPKey.OpenPGPPrivateKey unlock() throws PGPException
OpenPGPKey.OpenPGPSecretKey.PGPException - if the key cannot be unlockedpublic OpenPGPKey.OpenPGPPrivateKey unlock(KeyPassphraseProvider passphraseProvider) throws PGPException
OpenPGPKey.OpenPGPSecretKey.passphraseProvider - provider for key passphrasesPGPException - if the key cannot be unlockedpublic OpenPGPKey.OpenPGPPrivateKey unlock(char[] passphrase) throws PGPException
PGPKeyPair by unlocking the potentially locked secret key using the provided
passphrase. Note: If the key is not locked, it is sufficient to pass null as passphrase.passphrase - passphrase or nullPGPException - if the key cannot be unlockedpublic boolean isPassphraseCorrect(char[] passphrase)
passphrase - passphrase