Class JcePGPS2KCalculator
java.lang.Object
org.bouncycastle.openpgp.operator.jcajce.JcePGPS2KCalculator
- All Implemented Interfaces:
PGPS2KCalculator
A
PGPS2KCalculator for the JCA/JCE OpenPGP operators. The Argon2 key (RFC 9580 sec. 3.7.1.4)
is derived through the provider's SecretKeyFactory.ARGON2 (RFC 9106) rather than the
lightweight engine directly, so the provider is overridable via setProvider(Provider). The cost
parameters are bounded by the caller (PGPUtil.makeKeyFromPassPhrase) before this is invoked.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetType()Return the algorithm typebyte[]DerivekeyLenbytes from the supplied passphrase using the parameters carried by the givenArgon2S2K specifier.setProvider(String providerName) setProvider(Provider provider)
-
Constructor Details
-
JcePGPS2KCalculator
public JcePGPS2KCalculator()
-
-
Method Details
-
setProvider
-
setProvider
-
getType
public int getType()Description copied from interface:PGPS2KCalculatorReturn the algorithm type- Specified by:
getTypein interfacePGPS2KCalculator
-
makeKey
Description copied from interface:PGPS2KCalculatorDerivekeyLenbytes from the supplied passphrase using the parameters carried by the givenArgon2S2K specifier.- Specified by:
makeKeyin interfacePGPS2KCalculator- Parameters:
passPhrase- the passphrase.s2k- anS2K.ARGON_2S2K carrying the salt, passes, parallelism and memory size.keyLen- the number of key bytes to produce.- Returns:
- the derived key.
- Throws:
PGPException- on error.
-