Package org.bouncycastle.openpgp.api.bc
Class BcOpenPGPApi
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPApi
org.bouncycastle.openpgp.api.bc.BcOpenPGPApi
Implementation of
OpenPGPApi
using Bouncy Castles implementation of OpenPGP classes.-
Constructor Summary
ConstructorsConstructorDescriptionBcOpenPGPApi
(OpenPGPImplementation implementation) BcOpenPGPApi
(OpenPGPImplementation implementation, OpenPGPPolicy policy) BcOpenPGPApi
(OpenPGPPolicy policy) -
Method Summary
Modifier and TypeMethodDescriptiongenerateKey
(int version) Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
of the given key version.generateKey
(int version, Date creationTime) Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
of the given key version.generateKey
(int version, Date creationTime, boolean aeadProtection) Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
of the given key version.Methods inherited from class org.bouncycastle.openpgp.api.OpenPGPApi
createDetachedSignature, decryptAndOrVerifyMessage, editKey, editKey, editKey, generateKey, generateKey, generateKey, getImplementation, readKeyOrCertificate, signAndOrEncryptMessage, verifyDetachedSignature
-
Constructor Details
-
BcOpenPGPApi
public BcOpenPGPApi() -
BcOpenPGPApi
-
BcOpenPGPApi
-
BcOpenPGPApi
-
-
Method Details
-
generateKey
Description copied from class:OpenPGPApi
Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
of the given key version. Valid version numbers are:PublicKeyPacket.VERSION_4
(rfc4880)PublicKeyPacket.VERSION_6
(rfc9580)PublicKeyPacket.LIBREPGP_5
(LibrePGP; experimental)
- Specified by:
generateKey
in classOpenPGPApi
- Parameters:
version
- key version number- Returns:
- key generator
- Throws:
PGPException
- if the key generator cannot be set up
-
generateKey
Description copied from class:OpenPGPApi
Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
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)
- Specified by:
generateKey
in classOpenPGPApi
- Parameters:
version
- key version numbercreationTime
- key + signatures creation time- Returns:
- key generator
- Throws:
PGPException
- if the key generator cannot be set up
-
generateKey
public OpenPGPKeyGenerator generateKey(int version, Date creationTime, boolean aeadProtection) throws PGPException Description copied from class:OpenPGPApi
Return anOpenPGPKeyGenerator
which can be used to generateOpenPGPKeys
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)
- Specified by:
generateKey
in classOpenPGPApi
- Parameters:
creationTime
- key + signature creation timeaeadProtection
- whether to use AEAD or CFB protection- Returns:
- key generator
- Throws:
PGPException
- if the key generator cannot be set up
-