public abstract class OpenPGPApi
extends java.lang.Object
Constructor and Description |
---|
OpenPGPApi(OpenPGPImplementation implementation)
Instantiate an
OpenPGPApi based on the given OpenPGPImplementation . |
OpenPGPApi(OpenPGPImplementation implementation,
OpenPGPPolicy policy)
|
Modifier and Type | Method and Description |
---|---|
OpenPGPDetachedSignatureGenerator |
createDetachedSignature()
Create one or more detached signatures over some data.
|
OpenPGPMessageProcessor |
decryptAndOrVerifyMessage()
Decrypt and/or verify an OpenPGP message.
|
OpenPGPKeyEditor |
editKey(OpenPGPKey key) |
OpenPGPKeyEditor |
editKey(OpenPGPKey key,
char[] primaryKeyPassphrase) |
OpenPGPKeyEditor |
editKey(OpenPGPKey key,
KeyPassphraseProvider primaryKeyPassphraseProvider)
Modify an
OpenPGPKey . |
OpenPGPKeyGenerator |
generateKey()
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys . |
OpenPGPKeyGenerator |
generateKey(java.util.Date creationTime)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys . |
OpenPGPKeyGenerator |
generateKey(java.util.Date creationTime,
boolean aeadProtection)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys . |
abstract OpenPGPKeyGenerator |
generateKey(int version)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys
of the given key version. |
abstract OpenPGPKeyGenerator |
generateKey(int version,
java.util.Date creationTime)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys
of the given key version. |
abstract OpenPGPKeyGenerator |
generateKey(int version,
java.util.Date creationTime,
boolean aeadProtection)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys
of the given key version. |
OpenPGPImplementation |
getImplementation()
Return the underlying
OpenPGPImplementation of this API handle. |
OpenPGPKeyReader |
readKeyOrCertificate()
Return an
OpenPGPKeyReader which can be used to parse binary or ASCII armored
OpenPGPKeys or OpenPGPCertificates . |
OpenPGPMessageGenerator |
signAndOrEncryptMessage()
Create an inline-signed and/or encrypted OpenPGP message.
|
OpenPGPDetachedSignatureProcessor |
verifyDetachedSignature()
Verify detached signatures over some data.
|
public OpenPGPApi(OpenPGPImplementation implementation)
OpenPGPApi
based on the given OpenPGPImplementation
.implementation
- OpenPGP implementationpublic OpenPGPApi(OpenPGPImplementation implementation, OpenPGPPolicy policy)
implementation
- OpenPGP implementationpolicy
- algorithm policypublic OpenPGPKeyReader readKeyOrCertificate()
OpenPGPKeyReader
which can be used to parse binary or ASCII armored
OpenPGPKeys
or OpenPGPCertificates
.public OpenPGPKeyGenerator generateKey() throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
.
This method returns a generator for OpenPGP v6 keys as defined by rfc9580.PGPException
- if the key generator cannot be set uppublic abstract OpenPGPKeyGenerator generateKey(int version) throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
of the given key version.
Valid version numbers are:
PublicKeyPacket.VERSION_4
(rfc4880)PublicKeyPacket.VERSION_6
(rfc9580)PublicKeyPacket.LIBREPGP_5
(LibrePGP; experimental)version
- key version numberPGPException
- if the key generator cannot be set uppublic OpenPGPKeyGenerator generateKey(java.util.Date creationTime) throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
.
The key and signatures will have a creation time of the passed creationTime.
This method returns a generator for OpenPGP v6 keys as defined by rfc9580.creationTime
- key + signature creation timePGPException
- if the key generator cannot be set uppublic abstract OpenPGPKeyGenerator generateKey(int version, java.util.Date creationTime) throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
of the given key version.
The key and signatures will have a creation time of the passed creationTime.
Valid version numbers are:
PublicKeyPacket.VERSION_4
(rfc4880)PublicKeyPacket.VERSION_6
(rfc9580)PublicKeyPacket.LIBREPGP_5
(LibrePGP; experimental)version
- key version numbercreationTime
- key + signatures creation timePGPException
- if the key generator cannot be set uppublic OpenPGPKeyGenerator generateKey(java.util.Date creationTime, boolean aeadProtection) throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
.
The key and signatures will have a creation time of the passed creationTime.
If aeadProtection is true, the key will use AEAD+Argon2 to protect the secret key material,
otherwise it will use salted+iterated CFB mode.
This method returns a generator for OpenPGP v6 keys as defined by rfc9580.creationTime
- key + signature creation timeaeadProtection
- whether to use AEAD or CFB protectionPGPException
- if the key generator cannot be set uppublic abstract OpenPGPKeyGenerator generateKey(int version, java.util.Date creationTime, boolean aeadProtection) throws PGPException
OpenPGPKeyGenerator
which can be used to generate OpenPGPKeys
of the given key version.
The key and signatures will have a creation time of the passed creationTime.
If aeadProtection is true, the key will use AEAD+Argon2 to protect the secret key material,
otherwise it will use salted+iterated CFB mode.
Valid version numbers are:
PublicKeyPacket.VERSION_4
(rfc4880)PublicKeyPacket.VERSION_6
(rfc9580)PublicKeyPacket.LIBREPGP_5
(LibrePGP; experimental)creationTime
- key + signature creation timeaeadProtection
- whether to use AEAD or CFB protectionPGPException
- if the key generator cannot be set uppublic OpenPGPMessageGenerator signAndOrEncryptMessage()
public OpenPGPDetachedSignatureGenerator createDetachedSignature()
public OpenPGPMessageProcessor decryptAndOrVerifyMessage()
public OpenPGPDetachedSignatureProcessor verifyDetachedSignature()
public OpenPGPKeyEditor editKey(OpenPGPKey key) throws PGPException
PGPException
public OpenPGPKeyEditor editKey(OpenPGPKey key, char[] primaryKeyPassphrase) throws PGPException
PGPException
public OpenPGPKeyEditor editKey(OpenPGPKey key, KeyPassphraseProvider primaryKeyPassphraseProvider) throws PGPException
OpenPGPKey
.key
- OpenPGP keyPGPException
public OpenPGPImplementation getImplementation()
OpenPGPImplementation
of this API handle.