public class OpenPGPKeyEditor extends AbstractOpenPGPKeySignatureGenerator
defaultAeadAlgorithmPreferences, defaultCompressionAlgorithmPreferences, defaultFeatures, defaultHashAlgorithmPreferences, defaultSymmetricKeyPreferences, directKeySignatureSubpackets, encryptionSubkeySubpackets, signingSubkeySubpackets
Constructor and Description |
---|
OpenPGPKeyEditor(OpenPGPKey key,
KeyPassphraseProvider passphraseProvider) |
OpenPGPKeyEditor(OpenPGPKey key,
KeyPassphraseProvider passphraseProvider,
OpenPGPImplementation implementation) |
OpenPGPKeyEditor(OpenPGPKey key,
KeyPassphraseProvider passphraseProvider,
OpenPGPImplementation implementation,
OpenPGPPolicy policy) |
setDefaultAeadAlgorithmPreferences, setDefaultCompressionAlgorithmPreferences, setDefaultFeatures, setDefaultHashAlgorithmPreferences, setDefaultSymmetricKeyPreferences, setDirectKeySignatureSubpackets, setEncryptionSubkeySubpackets, setSigningSubkeySubpackets
public OpenPGPKeyEditor(OpenPGPKey key, KeyPassphraseProvider passphraseProvider) throws PGPException
PGPException
public OpenPGPKeyEditor(OpenPGPKey key, KeyPassphraseProvider passphraseProvider, OpenPGPImplementation implementation) throws PGPException
PGPException
public OpenPGPKeyEditor(OpenPGPKey key, KeyPassphraseProvider passphraseProvider, OpenPGPImplementation implementation, OpenPGPPolicy policy) throws PGPException
PGPException
public OpenPGPKeyEditor addDirectKeySignature(SignatureParameters.Callback signatureCallback) throws PGPException
PGPException
public OpenPGPKeyEditor addUserId(java.lang.String userId) throws PGPException
userId
- user-idPGPException
- if the key cannot be modifiedpublic OpenPGPKeyEditor addUserId(java.lang.String userId, SignatureParameters.Callback signatureCallback) throws PGPException
SignatureParameters.Callback
.
If the key already contains the given user-id, a new certification signature will be added to the user-id.userId
- user-idsignatureCallback
- callback to modify the certification signature contentsPGPException
- if the key cannot be modifiedpublic OpenPGPKeyEditor revokeIdentity(OpenPGPCertificate.OpenPGPIdentityComponent identity) throws PGPException
OpenPGPCertificate.OpenPGPIdentityComponent
.identity
- user-id to be revokedPGPException
- if the key cannot be modifiedpublic OpenPGPKeyEditor revokeIdentity(OpenPGPCertificate.OpenPGPIdentityComponent identity, SignatureParameters.Callback signatureCallback) throws PGPException
OpenPGPCertificate.OpenPGPUserId
, allowing modification of the revocation signature
using the given SignatureParameters.Callback
.identity
- user-id to revokesignatureCallback
- callback to modify the revocation signature contentsPGPException
- if the key cannot be modifiedpublic OpenPGPKeyEditor addEncryptionSubkey() throws PGPException
PGPException
public OpenPGPKeyEditor addEncryptionSubkey(KeyPairGeneratorCallback keyGenCallback) throws PGPException
PGPException
public OpenPGPKeyEditor addEncryptionSubkey(KeyPairGeneratorCallback keyGenCallback, int version, java.util.Date creationTime) throws PGPException
PGPException
public OpenPGPKeyEditor addEncryptionSubkey(PGPKeyPair encryptionSubkey, SignatureParameters.Callback bindingSigCallback) throws PGPException
PGPException
public OpenPGPKeyEditor addSigningSubkey() throws PGPException
PGPException
public OpenPGPKeyEditor addSigningSubkey(KeyPairGeneratorCallback keyGenCallback) throws PGPException
PGPException
public OpenPGPKeyEditor addSigningSubkey(KeyPairGeneratorCallback keyGenCallback, int version, java.util.Date creationTime) throws PGPException
PGPException
public OpenPGPKeyEditor addSigningSubkey(PGPKeyPair signingSubkey, SignatureParameters.Callback bindingSigCallback, SignatureParameters.Callback backSigCallback) throws PGPException
PGPException
public OpenPGPKeyEditor addSubkey(PGPKeyPair subkey, SignatureParameters.Callback bindingSigCallback, SignatureParameters.Callback backSigCallback) throws PGPException
subkey
- component keybindingSigCallback
- callback to modify the subkey binding signaturebackSigCallback
- callback to modify the embedded primary key binding signaturePGPException
public OpenPGPKeyEditor revokeComponentKey(OpenPGPCertificate.OpenPGPComponentKey componentKey) throws PGPException
PGPException
public OpenPGPKeyEditor revokeComponentKey(OpenPGPCertificate.OpenPGPComponentKey componentKey, SignatureParameters.Callback revocationSignatureCallback) throws PGPException
PGPException
public OpenPGPKeyEditor revokeKey() throws PGPException
PGPException
public OpenPGPKeyEditor revokeKey(SignatureParameters.Callback revocationSignatureCallback) throws PGPException
PGPException
public OpenPGPKeyEditor changePassphrase(KeyIdentifier componentKeyIdentifier, char[] oldPassphrase, char[] newPassphrase, boolean useAEAD) throws OpenPGPKeyException, PGPException
componentKeyIdentifier
- identifier of the component key, whose passphrase shall be changedoldPassphrase
- old passphrase (or null)newPassphrase
- new passphrase (or null)useAEAD
- whether to use AEADOpenPGPKeyException
- if the secret component of the component key is missingPGPException
- if the key passphrase cannot be changedpublic OpenPGPKey done()
OpenPGPKey
.