Bouncy Castle Cryptography Library 1.81

org.bouncycastle.openpgp.operator.bc
Class BcAEADSecretKeyEncryptorBuilder

java.lang.Object
  extended byorg.bouncycastle.openpgp.operator.bc.BcAEADSecretKeyEncryptorBuilder
All Implemented Interfaces:
AEADSecretKeyEncryptorBuilder

public class BcAEADSecretKeyEncryptorBuilder
extends java.lang.Object
implements AEADSecretKeyEncryptorBuilder


Constructor Summary
BcAEADSecretKeyEncryptorBuilder(int aeadAlgorithm, int symmetricAlgorithm, S2K.Argon2Params argon2Params)
           
 
Method Summary
 PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKey)
          Build a new PBESecretKeyEncryptor using the given passphrase.
 BcAEADSecretKeyEncryptorBuilder setSecureRandom(java.security.SecureRandom random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BcAEADSecretKeyEncryptorBuilder

public BcAEADSecretKeyEncryptorBuilder(int aeadAlgorithm,
                                       int symmetricAlgorithm,
                                       S2K.Argon2Params argon2Params)
Method Detail

setSecureRandom

public BcAEADSecretKeyEncryptorBuilder setSecureRandom(java.security.SecureRandom random)

build

public PBESecretKeyEncryptor build(char[] passphrase,
                                   PublicKeyPacket pubKey)
Description copied from interface: AEADSecretKeyEncryptorBuilder
Build a new PBESecretKeyEncryptor using the given passphrase. Note: As the AEAD protection mechanism includes the public key packet of the key into the calculation, if the key you want to protect is supposed to be a subkey, you need to convert it to one before calling this method. See PGPKeyPair.asSubkey(KeyFingerPrintCalculator).

Specified by:
build in interface AEADSecretKeyEncryptorBuilder
Parameters:
passphrase - passphrase
pubKey - public primary or subkey packet
Returns:
encryptor using AEAD

Bouncy Castle Cryptography Library 1.81