Package org.bouncycastle.jcajce.spec
Class KTSExtractKeySpec.Builder
- java.lang.Object
-
- org.bouncycastle.jcajce.spec.KTSExtractKeySpec.Builder
-
- Enclosing class:
- KTSExtractKeySpec
public static final class KTSExtractKeySpec.Builder extends java.lang.Object
Builder class for creating a KTSExtractKeySpec.
-
-
Constructor Summary
Constructors Constructor Description Builder(java.security.PrivateKey privateKey, byte[] encapsulation, java.lang.String algorithmName, int keySizeInBits)
Basic builder.Builder(java.security.PrivateKey privateKey, byte[] encapsulation, java.lang.String algorithmName, int keySizeInBits, byte[] otherInfo)
Basic builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KTSExtractKeySpec
build()
Build the new key spec.KTSExtractKeySpec.Builder
withKdfAlgorithm(AlgorithmIdentifier kdfAlgorithm)
Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).KTSExtractKeySpec.Builder
withKdfAlgorithm(FipsKDF.AgreementKDFParametersBuilder kdfAlgorithm)
Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).KTSExtractKeySpec.Builder
withMac(java.lang.String macAlgorithmName, int macKeySizeInBits)
Set the MAC algorithm name and its associated key size for the MAC key in the encapsulation.KTSExtractKeySpec.Builder
withParameterSpec(java.security.spec.AlgorithmParameterSpec parameterSpec)
Set the algorithm parameter spec to be used with the private key.
-
-
-
Constructor Detail
-
Builder
public Builder(java.security.PrivateKey privateKey, byte[] encapsulation, java.lang.String algorithmName, int keySizeInBits)
Basic builder.- Parameters:
privateKey
- the private key to use to extract the secret from the encapsulation.encapsulation
- the encapsulated secret.algorithmName
- the algorithm name for the secret key we wish to calculate.keySizeInBits
- the size of the key we want to produce in bits.
-
Builder
public Builder(java.security.PrivateKey privateKey, byte[] encapsulation, java.lang.String algorithmName, int keySizeInBits, byte[] otherInfo)
Basic builder.- Parameters:
privateKey
- the private key to use to extract the secret from the encapsulation.encapsulation
- the encapsulated secret.algorithmName
- the algorithm name for the secret key we wish to calculate.keySizeInBits
- the size of the key we want to produce in bits.
-
-
Method Detail
-
withKdfAlgorithm
public KTSExtractKeySpec.Builder withKdfAlgorithm(FipsKDF.AgreementKDFParametersBuilder kdfAlgorithm)
Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).- Parameters:
kdfAlgorithm
- the KDF algorithm to apply.- Returns:
- the current Builder instance.
-
withKdfAlgorithm
public KTSExtractKeySpec.Builder withKdfAlgorithm(AlgorithmIdentifier kdfAlgorithm)
Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).- Parameters:
kdfAlgorithm
- the KDF algorithm to apply.- Returns:
- the current Builder instance.
-
withMac
public KTSExtractKeySpec.Builder withMac(java.lang.String macAlgorithmName, int macKeySizeInBits)
Set the MAC algorithm name and its associated key size for the MAC key in the encapsulation.- Parameters:
macAlgorithmName
- name of the MAC algorithm we will use.macKeySizeInBits
- size of the MAC key (in bits)- Returns:
- the current Builder instance.
-
withParameterSpec
public KTSExtractKeySpec.Builder withParameterSpec(java.security.spec.AlgorithmParameterSpec parameterSpec)
Set the algorithm parameter spec to be used with the private key.- Parameters:
parameterSpec
- the algorithm parameter spec to be used in decryption.- Returns:
- the current Builder instance.
-
build
public KTSExtractKeySpec build()
Build the new key spec.- Returns:
- a new key spec configured according to the builder state.
-
-