Class ScryptParams

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.internal.asn1.misc.ScryptParams
All Implemented Interfaces:
ASN1Encodable, Encodable

public class ScryptParams extends ASN1Object
RFC 7914 scrypt parameters.
 scrypt-params ::= SEQUENCE {
      salt OCTET STRING,
      costParameter INTEGER (1..MAX),
      blockSize INTEGER (1..MAX),
      parallelizationParameter INTEGER (1..MAX),
      keyLength INTEGER (1..MAX) OPTIONAL
 }
 
  • Constructor Details

    • ScryptParams

      public ScryptParams(byte[] salt, int costParameter, int blockSize, int parallelizationParameter)
    • ScryptParams

      public ScryptParams(byte[] salt, int costParameter, int blockSize, int parallelizationParameter, int keyLength)
    • ScryptParams

      public ScryptParams(byte[] salt, BigInteger costParameter, BigInteger blockSize, BigInteger parallelizationParameter, BigInteger keyLength)
      Base constructor.
      Parameters:
      salt - salt value
      costParameter - specifies the CPU/Memory cost parameter N
      blockSize - block size parameter r
      parallelizationParameter - parallelization parameter
      keyLength - length of key to be derived (in octects)
  • Method Details

    • getInstance

      public static ScryptParams getInstance(Object o)
    • getSalt

      public byte[] getSalt()
    • getCostParameter

      public BigInteger getCostParameter()
    • getBlockSize

      public BigInteger getBlockSize()
    • getParallelizationParameter

      public BigInteger getParallelizationParameter()
    • getKeyLength

      public BigInteger getKeyLength()
      Return the length in octets for the derived key.
      Returns:
      length for key to be derived (in octets)
    • toASN1Primitive

      public ASN1Primitive toASN1Primitive()
      Description copied from class: ASN1Object
      Method providing a primitive representation of this object suitable for encoding.
      Specified by:
      toASN1Primitive in interface ASN1Encodable
      Specified by:
      toASN1Primitive in class ASN1Object
      Returns:
      a primitive representation of this object.