Bouncy Castle Cryptography Library 1.85

org.bouncycastle.openpgp.operator
Interface PGPS2KCalculator

All Known Implementing Classes:
BcPGPS2KCalculator, JcePGPS2KCalculator

public interface PGPS2KCalculator

Derives a key from a passphrase for a memory-hard S2K specifier (currently Argon2, RFC 9580 sec. 3.7.1.4).

This is the operator-level abstraction for the one part of the OpenPGP string-to-key process that is not expressible through a PGPDigestCalculator: a memory-hard KDF. Concrete implementations live in the and operator subpackages so that the top-level operator package does not depend on a particular crypto provider.


Method Summary
 int getType()
          Return the algorithm type
 byte[] makeKey(char[] passPhrase, S2K s2k, int keyLen)
          Derive bytes from the supplied passphrase using the parameters carried by the given Argon2 S2K specifier.
 

Method Detail

getType

public int getType()
Return the algorithm type


makeKey

public byte[] makeKey(char[] passPhrase,
                      S2K s2k,
                      int keyLen)
               throws PGPException
Derive bytes from the supplied passphrase using the parameters carried by the given Argon2 S2K specifier.

Parameters:
passPhrase - the passphrase.
s2k - an S2K.ARGON_2 S2K carrying the salt, passes, parallelism and memory size.
keyLen - the number of key bytes to produce.
Returns:
the derived key.
Throws:
PGPException - on error.

Bouncy Castle Cryptography Library 1.85