Class BcPGPS2KCalculator

java.lang.Object
org.bouncycastle.openpgp.operator.bc.BcPGPS2KCalculator
All Implemented Interfaces:
PGPS2KCalculator

public class BcPGPS2KCalculator extends Object implements PGPS2KCalculator
A PGPS2KCalculator backed by the lightweight Argon2BytesGenerator. The cost parameters are bounded by the caller (PGPUtil.makeKeyFromPassPhrase) before this is invoked.
  • Constructor Details

    • BcPGPS2KCalculator

      public BcPGPS2KCalculator()
  • Method Details

    • getType

      public int getType()
      Description copied from interface: PGPS2KCalculator
      Return the algorithm type
      Specified by:
      getType in interface PGPS2KCalculator
    • makeKey

      public byte[] makeKey(char[] passPhrase, S2K s2k, int keyLen) throws PGPException
      Description copied from interface: PGPS2KCalculator
      Derive keyLen bytes from the supplied passphrase using the parameters carried by the given Argon2 S2K specifier.
      Specified by:
      makeKey in interface PGPS2KCalculator
      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.