Top Fields Constructors Methods
org.bouncycastle.openpgp.operator.bc

public Class BcAEADSecretKeyEncryptorBuilder

extends Object
implements AEADSecretKeyEncryptorBuilder
Class Inheritance
All Implemented Interfaces
org.bouncycastle.openpgp.operator.AEADSecretKeyEncryptorBuilder
Imports
java.io.IOException, java.security.SecureRandom, org.bouncycastle.bcpg.AEADUtils, .PacketTags, .PublicKeyPacket, .S2K, org.bouncycastle.openpgp.PGPException, org.bouncycastle.openpgp.operator.AEADSecretKeyEncryptorBuilder, .PBESecretKeyEncryptor

Field Summary

Modifier and TypeField and Description
private int
private S2K.Argon2Params
private SecureRandom
private int

Constructor Summary

AccessConstructor and Description
public
BcAEADSecretKeyEncryptorBuilder(int aeadAlgorithm, int symmetricAlgorithm, S2K.Argon2Params argon2Params)

Method Summary

Modifier and TypeMethod and Description
public PBESecretKeyEncryptor
build(char[]
passphrase
passphrase
,
final PublicKeyPacket
public primary or subkey packet
pubKey
)

Implements org.bouncycastle.openpgp.operator.AEADSecretKeyEncryptorBuilder.build.

Build a new PBESecretKeyEncryptor using the given passphrase.

public BcAEADSecretKeyEncryptorBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aeadAlgorithmback to summary
private int aeadAlgorithm
argon2Paramsback to summary
private S2K.Argon2Params argon2Params
randomback to summary
private SecureRandom random
symmetricAlgorithmback to summary
private int symmetricAlgorithm

Constructor Detail

BcAEADSecretKeyEncryptorBuilderback to summary
public BcAEADSecretKeyEncryptorBuilder(int aeadAlgorithm, int symmetricAlgorithm, S2K.Argon2Params argon2Params)

Method Detail

buildback to summary
public PBESecretKeyEncryptor build(char[] passphrase, final PublicKeyPacket pubKey)

Implements org.bouncycastle.openpgp.operator.AEADSecretKeyEncryptorBuilder.build.

Doc from org.bouncycastle.openpgp.operator.AEADSecretKeyEncryptorBuilder.build.

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 org.bouncycastle.openpgp.PGPKeyPair#asSubkey(KeyFingerPrintCalculator).

Parameters
passphrase:char[]

passphrase

pubKey:PublicKeyPacket

public primary or subkey packet

Returns:PBESecretKeyEncryptor

encryptor using AEAD

setSecureRandomback to summary
public BcAEADSecretKeyEncryptorBuilder setSecureRandom(SecureRandom random)