Class 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 Detail

      • 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,
                            java.math.BigInteger costParameter,
                            java.math.BigInteger blockSize,
                            java.math.BigInteger parallelizationParameter,
                            java.math.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 Detail

      • getInstance

        public static ScryptParams getInstance​(java.lang.Object o)
      • getSalt

        public byte[] getSalt()
      • getCostParameter

        public java.math.BigInteger getCostParameter()
      • getBlockSize

        public java.math.BigInteger getBlockSize()
      • getParallelizationParameter

        public java.math.BigInteger getParallelizationParameter()
      • getKeyLength

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