Class PKCS8EncryptionProperties

java.lang.Object
com.unboundid.util.ssl.cert.PKCS8EncryptionProperties
All Implemented Interfaces:
Serializable

This class defines a set of properties that may be used when encrypting a PKCS #8 private key.
See Also:
  • Constructor Details

    • PKCS8EncryptionProperties

      Creates a set of PKCS #8 encryption properties with the default settings.
  • Method Details

    • getKeyFactoryPRFAlgorithm

      Retrieves the algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.
      Returns:
      The algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.
    • setKeyFactoryPRFAlgorithm

      public void setKeyFactoryPRFAlgorithm(@NotNull PKCS5AlgorithmIdentifier keyFactoryPRFAlgorithm) throws CertException
      Specifies the algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password.
      Parameters:
      keyFactoryPRFAlgorithm - The algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password. It must not be null, and it must represent a valid pseudorandom function.
      Throws:
      CertException - If the provided algorithm identifier does not represent a valid pseudorandom function.
    • getKeyFactoryIterationCount

      Retrieves the iteration count to use when generating the encryption key from the provided password.
      Returns:
      The iteration count to use when generating the encryption key from the provided password.
    • setKeyFactoryIterationCount

      public void setKeyFactoryIterationCount(int keyFactoryIterationCount)
      Specifies the iteration count to use when generating the encryption key from the provided password.
      Parameters:
      keyFactoryIterationCount - The iteration count to use when generating the encryption key from the provided password. It must be greater than zero.
    • getKeyFactorySaltLengthBytes

      Retrieves the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
      Returns:
      The length in bytes to use for the key factory salt when generating the encryption key from the provided password.
    • setKeyFactorySaltLengthBytes

      public void setKeyFactorySaltLengthBytes(int keyFactorySaltLengthBytes)
      Specifies the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
      Parameters:
      keyFactorySaltLengthBytes - The length in bytes to use for the key factory salt when generating the encryption key from the provided password. It must be greater than zero.
    • getCipherTransformationAlgorithm

      Retrieves the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
      Returns:
      The algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
    • setCipherTransformationAlgorithm

      public void setCipherTransformationAlgorithm(@NotNull PKCS5AlgorithmIdentifier cipherTransformationAlgorithm) throws CertException
      Specifies the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
      Parameters:
      cipherTransformationAlgorithm - The algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key. It must not be null, and it must represent a valid cipher transformation.
      Throws:
      CertException - If the provided algorithm identifier does not represent a valid cipher transformation.
    • toString

      Retrieves a string representation of the PKCS #8 encryption properties.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the PKCS #8 encryption properties.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of the PKCS #8 encryption properties to the provided buffer.
      Parameters:
      buffer - The buffer to which the information should be appended. It must not be null.