Class DSSSecureRandomProvider

java.lang.Object
eu.europa.esig.dss.pdf.encryption.DSSSecureRandomProvider
All Implemented Interfaces:
SecureRandomProvider

public class DSSSecureRandomProvider extends Object implements SecureRandomProvider
Default SecureRandomProvider used in DSS, returning org.bouncycastle.crypto.prng.FixedSecureRandom instance
  • Constructor Details

    • DSSSecureRandomProvider

      public DSSSecureRandomProvider(PAdESCommonParameters parameters)
      The default constructor taking an object to compute seeds from. Concatenates all attributes from PAdESCommonParameters to a BAOS.
      Parameters:
      parameters - PAdESCommonParameters to compute seed value from
    • DSSSecureRandomProvider

      public DSSSecureRandomProvider(SignatureImageParameters imageParameters)
      Constructor to instantiate DSSSecureRandomProvider from image parameters. Concatenates all attributes from SignatureImageParameters to a BAOS.
      Parameters:
      imageParameters - SignatureImageParameters to compute seed value from
  • Method Details

    • setDigestAlgorithm

      public void setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
      Allows to set a DigestAlgorithm that will be applied on serialized parameters
      Parameters:
      digestAlgorithm - DigestAlgorithm
    • setBinaryLength

      public void setBinaryLength(int binaryLength)
      Sets the amount of bytes to be computed for FixedSecureRandom 16 bytes is required per one AES Vector initialization
      Parameters:
      binaryLength - number of bytes
    • getSecureRandom

      public SecureRandom getSecureRandom()
      Description copied from interface: SecureRandomProvider
      Gets SecureRandom instance
      Specified by:
      getSecureRandom in interface SecureRandomProvider
      Returns:
      SecureRandom