public class BcOpenPGPApi extends OpenPGPApi
OpenPGPApi
using Bouncy Castles implementation of OpenPGP classes.Constructor and Description |
---|
BcOpenPGPApi() |
BcOpenPGPApi(OpenPGPImplementation implementation) |
BcOpenPGPApi(OpenPGPImplementation implementation,
OpenPGPPolicy policy) |
BcOpenPGPApi(OpenPGPPolicy policy) |
Modifier and Type | Method and Description |
---|---|
OpenPGPKeyGenerator |
generateKey(int version)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys
of the given key version. |
OpenPGPKeyGenerator |
generateKey(int version,
java.util.Date creationTime)
Return an
OpenPGPKeyGenerator which can be used to generate OpenPGPKeys
of the given key version. |
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. |
createDetachedSignature, decryptAndOrVerifyMessage, editKey, editKey, editKey, generateKey, generateKey, generateKey, getImplementation, readKeyOrCertificate, signAndOrEncryptMessage, verifyDetachedSignature
public BcOpenPGPApi()
public BcOpenPGPApi(OpenPGPImplementation implementation)
public BcOpenPGPApi(OpenPGPPolicy policy)
public BcOpenPGPApi(OpenPGPImplementation implementation, OpenPGPPolicy policy)
public OpenPGPKeyGenerator generateKey(int version) throws PGPException
OpenPGPApi
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)generateKey
in class OpenPGPApi
version
- key version numberPGPException
- if the key generator cannot be set uppublic OpenPGPKeyGenerator generateKey(int version, java.util.Date creationTime) throws PGPException
OpenPGPApi
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)generateKey
in class OpenPGPApi
version
- key version numbercreationTime
- key + signatures creation timePGPException
- if the key generator cannot be set uppublic OpenPGPKeyGenerator generateKey(int version, java.util.Date creationTime, boolean aeadProtection) throws PGPException
OpenPGPApi
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)generateKey
in class OpenPGPApi
creationTime
- key + signature creation timeaeadProtection
- whether to use AEAD or CFB protectionPGPException
- if the key generator cannot be set up