public static class OpenPGPKey.OpenPGPPrivateKey
extends java.lang.Object
OpenPGPKey.OpenPGPSecretKey
.Constructor and Description |
---|
OpenPGPPrivateKey(OpenPGPKey.OpenPGPSecretKey secretKey,
PGPKeyPair unlockedKey) |
Modifier and Type | Method and Description |
---|---|
OpenPGPKey.OpenPGPSecretKey |
changePassphrase(char[] newPassphrase)
Return a NEW instance of the
OpenPGPKey.OpenPGPSecretKey locked with the new passphrase. |
OpenPGPKey.OpenPGPSecretKey |
changePassphrase(char[] newPassphrase,
OpenPGPImplementation implementation,
boolean useAEAD)
Return a NEW instance of the
OpenPGPKey.OpenPGPSecretKey locked with the new passphrase. |
OpenPGPKey.OpenPGPSecretKey |
changePassphrase(char[] newPassphrase,
PBESecretKeyEncryptorFactory keyEncryptorFactory)
Return a NEW instance of the
OpenPGPKey.OpenPGPSecretKey locked with the new passphrase. |
OpenPGPKey.OpenPGPSecretKey |
changePassphrase(PBESecretKeyEncryptor keyEncryptor)
Return a NEW instance of the
OpenPGPKey.OpenPGPSecretKey locked using the given PBESecretKeyEncryptor . |
PGPKeyPair |
getKeyPair()
Return the unlocked
PGPKeyPair containing the decrypted PGPPrivateKey . |
OpenPGPCertificate.OpenPGPComponentKey |
getPublicKey()
Return the public
OpenPGPComponentKey of this OpenPGPKey.OpenPGPPrivateKey . |
OpenPGPKey.OpenPGPSecretKey |
getSecretKey()
Return the
OpenPGPKey.OpenPGPSecretKey in its potentially locked form. |
OpenPGPKey.OpenPGPSecretKey |
removePassphrase()
Return a NEW instance of the
OpenPGPKey.OpenPGPSecretKey with removed passphrase protection. |
public OpenPGPPrivateKey(OpenPGPKey.OpenPGPSecretKey secretKey, PGPKeyPair unlockedKey)
public OpenPGPCertificate.OpenPGPComponentKey getPublicKey()
OpenPGPComponentKey
of this OpenPGPKey.OpenPGPPrivateKey
.public OpenPGPKey.OpenPGPSecretKey getSecretKey()
OpenPGPKey.OpenPGPSecretKey
in its potentially locked form.public PGPKeyPair getKeyPair()
PGPKeyPair
containing the decrypted PGPPrivateKey
.public OpenPGPKey.OpenPGPSecretKey changePassphrase(char[] newPassphrase) throws PGPException
OpenPGPKey.OpenPGPSecretKey
locked with the new passphrase.
If the key was unprotected before, or if it was protected using AEAD, the new instance will be
protected using AEAD as well.newPassphrase
- new passphrasePGPException
- if the key cannot be lockedpublic OpenPGPKey.OpenPGPSecretKey changePassphrase(char[] newPassphrase, OpenPGPImplementation implementation, boolean useAEAD) throws PGPException
OpenPGPKey.OpenPGPSecretKey
locked with the new passphrase.newPassphrase
- new passphraseimplementation
- OpenPGP implementationuseAEAD
- whether to protect the key using AEADPGPException
- if the key cannot be lockedpublic OpenPGPKey.OpenPGPSecretKey changePassphrase(char[] newPassphrase, PBESecretKeyEncryptorFactory keyEncryptorFactory) throws PGPException
OpenPGPKey.OpenPGPSecretKey
locked with the new passphrase.newPassphrase
- new passphrasekeyEncryptorFactory
- factory for PBESecretKeyEncryptor
instancesPGPException
- if the key cannot be lockedpublic OpenPGPKey.OpenPGPSecretKey changePassphrase(PBESecretKeyEncryptor keyEncryptor) throws PGPException
OpenPGPKey.OpenPGPSecretKey
locked using the given PBESecretKeyEncryptor
.keyEncryptor
- encryptorPGPException
- if the key cannot be lockedpublic OpenPGPKey.OpenPGPSecretKey removePassphrase() throws PGPException
OpenPGPKey.OpenPGPSecretKey
with removed passphrase protection.PGPException
- if the key cannot be unlocked