public static final class KTSGenerateKeySpec.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder(java.security.PublicKey publicKey,
java.lang.String algorithmName,
int keySizeInBits)
Basic builder.
|
Builder(java.security.PublicKey publicKey,
java.lang.String algorithmName,
int keySizeInBits,
byte[] otherInfo)
Basic builder.
|
| Modifier and Type | Method and Description |
|---|---|
KTSGenerateKeySpec |
build()
Build the new key spec.
|
KTSGenerateKeySpec.Builder |
withKdfAlgorithm(AlgorithmIdentifier kdfAlgorithm)
Set the KDF algorithm and digest algorithm for key generation.
|
KTSGenerateKeySpec.Builder |
withKdfAlgorithm(FipsKDF.AgreementKDFParametersBuilder kdfBuilder)
Set the KDF algorithm and digest algorithm for key generation.
|
KTSGenerateKeySpec.Builder |
withKdfSalt(byte[] salt)
Set the KDF salt for key generation (ignored for OAEP).
|
KTSGenerateKeySpec.Builder |
withMac(java.lang.String macAlgorithmName,
int macKeySizeInBits)
Set the MAC algorithm name and its associated key size for the MAC key section of the secret.
|
KTSGenerateKeySpec.Builder |
withParameterSpec(java.security.spec.AlgorithmParameterSpec parameterSpec)
Set the algorithm parameter spec to be used with the public key.
|
KTSGenerateKeySpec.Builder |
withSecureRandom(java.security.SecureRandom random)
Set the SecureRandom which will be used to generate the secret.
|
public Builder(java.security.PublicKey publicKey,
java.lang.String algorithmName,
int keySizeInBits)
publicKey - the public key to be used for encryption/encapsulation generation.algorithmName - the algorithm name for the secret key we wish to calculate.keySizeInBits - the size of the key we want to produce in bits.public Builder(java.security.PublicKey publicKey,
java.lang.String algorithmName,
int keySizeInBits,
byte[] otherInfo)
publicKey - the public key to be used for encryption/encapsulation generation.algorithmName - the algorithm name for the secret key we wish to calculate.keySizeInBits - the size of the key we want to produce in bits.otherInfo - the otherInfo/IV encoding to be applied to the KDF.public KTSGenerateKeySpec.Builder withSecureRandom(java.security.SecureRandom random)
random - the source of randomness for the secret.public KTSGenerateKeySpec.Builder withMac(java.lang.String macAlgorithmName, int macKeySizeInBits)
macAlgorithmName - name of the MAC algorithm we will use.macKeySizeInBits - size of the MAC key (in bits)public KTSGenerateKeySpec.Builder withParameterSpec(java.security.spec.AlgorithmParameterSpec parameterSpec)
parameterSpec - the algorithm parameter spec to be used in encryption.public KTSGenerateKeySpec.Builder withKdfAlgorithm(FipsKDF.AgreementKDFParametersBuilder kdfBuilder)
kdfBuilder - the KDF algorithm to apply.public KTSGenerateKeySpec.Builder withKdfAlgorithm(AlgorithmIdentifier kdfAlgorithm)
kdfAlgorithm - the KDF algorithm to apply.public KTSGenerateKeySpec.Builder withKdfSalt(byte[] salt)
salt - the salt for initialising the KDF PRF.public KTSGenerateKeySpec build()