Package com.unboundid.util.ssl.cert
Class PKCS8EncryptionProperties
- java.lang.Object
-
- com.unboundid.util.ssl.cert.PKCS8EncryptionProperties
-
- All Implemented Interfaces:
java.io.Serializable
@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class PKCS8EncryptionProperties extends java.lang.Object implements java.io.Serializable
This class defines a set of properties that may be used when encrypting a PKCS #8 private key.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PKCS8EncryptionProperties()
Creates a set of PKCS #8 encryption properties with the default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PKCS5AlgorithmIdentifier
getCipherTransformationAlgorithm()
Retrieves the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.int
getKeyFactoryIterationCount()
Retrieves the iteration count to use when generating the encryption key from the provided password.PKCS5AlgorithmIdentifier
getKeyFactoryPRFAlgorithm()
Retrieves the algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.int
getKeyFactorySaltLengthBytes()
Retrieves the length in bytes to use for the key factory salt when generating the encryption key from the provided password.void
setCipherTransformationAlgorithm(PKCS5AlgorithmIdentifier cipherTransformationAlgorithm)
Specifies the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.void
setKeyFactoryIterationCount(int keyFactoryIterationCount)
Specifies the iteration count to use when generating the encryption key from the provided password.void
setKeyFactoryPRFAlgorithm(PKCS5AlgorithmIdentifier keyFactoryPRFAlgorithm)
Specifies the algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password.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.java.lang.String
toString()
Retrieves a string representation of the PKCS #8 encryption properties.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of the PKCS #8 encryption properties to the provided buffer.
-
-
-
Constructor Detail
-
PKCS8EncryptionProperties
public PKCS8EncryptionProperties()
Creates a set of PKCS #8 encryption properties with the default settings.
-
-
Method Detail
-
getKeyFactoryPRFAlgorithm
@NotNull public PKCS5AlgorithmIdentifier 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 benull
, and it must represent a valid pseudorandom function.- Throws:
CertException
- If the provided algorithm identifier does not represent a valid pseudorandom function.
-
getKeyFactoryIterationCount
public int 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
public int 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
@NotNull public PKCS5AlgorithmIdentifier 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 benull
, and it must represent a valid cipher transformation.- Throws:
CertException
- If the provided algorithm identifier does not represent a valid cipher transformation.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of the PKCS #8 encryption properties.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the PKCS #8 encryption properties.
-
-