Top Description Inners Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class KTSExtractKeySpec

extends KTSKeySpec
Class Inheritance
Imports
java.security.PrivateKey, java.security.spec.AlgorithmParameterSpec, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.fips.FipsKDF, org.bouncycastle.util.Arrays

KeySpec for use with secret key extraction with a SecretKeyFactory supporting KTS.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
KTSExtractKeySpec.Builder

Builder class for creating a KTSExtractKeySpec.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final PrivateKey
Inherited from org.bouncycastle.jcajce.spec.KTSKeySpec:
KDF2KDF3

Constructor Summary

AccessConstructor and Description
private
KTSExtractKeySpec(PrivateKey privateKey, byte[] encapsulation, String algorithmName, int keySize, String macAlgorithm, int macKeySizeInBits, AlgorithmParameterSpec parameterSpec, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the secret encapsulation.
getEncapsulation
()

Return the encapsulation of the secret associated with this key spec.

public PrivateKey

Returns:

the private key to be used to decrypt the encapsulation.
getPrivateKey
()

Return the decryption private key to be used by the SecretKeyFactory used with this key spec.

Inherited from org.bouncycastle.jcajce.spec.KTSKeySpec:
copyOtherInfocreateAlgIdgetKdfAlgorithmIdgetKeyAlgorithmNamegetKeySizegetMacAlgorithmNamegetMacKeySizegetOtherInfogetParameterSpec

Field Detail

encapsulationback to summary
private final byte[] encapsulation
privateKeyback to summary
private final PrivateKey privateKey

Constructor Detail

KTSExtractKeySpecback to summary
private KTSExtractKeySpec(PrivateKey privateKey, byte[] encapsulation, String algorithmName, int keySize, String macAlgorithm, int macKeySizeInBits, AlgorithmParameterSpec parameterSpec, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)

Method Detail

getEncapsulationback to summary
public byte[] getEncapsulation()

Return the encapsulation of the secret associated with this key spec.

Returns:byte[]

the secret encapsulation.

getPrivateKeyback to summary
public PrivateKey getPrivateKey()

Return the decryption private key to be used by the SecretKeyFactory used with this key spec.

Returns:PrivateKey

the private key to be used to decrypt the encapsulation.

org.bouncycastle.jcajce.spec back to summary

public final Class KTSExtractKeySpec.Builder

extends Object
Class Inheritance

Builder class for creating a KTSExtractKeySpec.

Field Summary

Modifier and TypeField and Description
private final String
private final byte[]
private AlgorithmIdentifier
private final int
private String
private int
private final byte[]
private AlgorithmParameterSpec
private final PrivateKey

Constructor Summary

AccessConstructor and Description
public
Builder(PrivateKey
the private key to use to extract the secret from the encapsulation.
privateKey
,
byte[]
the encapsulated secret.
encapsulation
,
String
the algorithm name for the secret key we wish to calculate.
algorithmName
,
int
the size of the key we want to produce in bits.
keySizeInBits
)

Basic builder.

public
Builder(PrivateKey
the private key to use to extract the secret from the encapsulation.
privateKey
,
byte[]
the encapsulated secret.
encapsulation
,
String
the algorithm name for the secret key we wish to calculate.
algorithmName
,
int
the size of the key we want to produce in bits.
keySizeInBits
,
byte[] otherInfo)

Basic builder.

Method Summary

Modifier and TypeMethod and Description
public KTSExtractKeySpec

Returns:

a new key spec configured according to the builder state.
build
()

Build the new key spec.

public KTSExtractKeySpec.Builder

Returns:

the current Builder instance.
withKdfAlgorithm
(FipsKDF.AgreementKDFParametersBuilder
the KDF algorithm to apply.
kdfAlgorithm
)

Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).

public KTSExtractKeySpec.Builder

Returns:

the current Builder instance.
withKdfAlgorithm
(AlgorithmIdentifier
the KDF algorithm to apply.
kdfAlgorithm
)

Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).

public KTSExtractKeySpec.Builder

Returns:

the current Builder instance.
withMac
(String
name of the MAC algorithm we will use.
macAlgorithmName
,
int
size of the MAC key (in bits)
macKeySizeInBits
)

Set the MAC algorithm name and its associated key size for the MAC key in the encapsulation.

public KTSExtractKeySpec.Builder

Returns:

the current Builder instance.
withParameterSpec
(AlgorithmParameterSpec
the algorithm parameter spec to be used in decryption.
parameterSpec
)

Set the algorithm parameter spec to be used with the private key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmNameback to summary
private final String algorithmName
encapsulationback to summary
private final byte[] encapsulation
kdfAlgorithmback to summary
private AlgorithmIdentifier kdfAlgorithm
keySizeInBitsback to summary
private final int keySizeInBits
macAlgorithmback to summary
private String macAlgorithm
macKeySizeInBitsback to summary
private int macKeySizeInBits
otherInfoback to summary
private final byte[] otherInfo
parameterSpecback to summary
private AlgorithmParameterSpec parameterSpec
privateKeyback to summary
private final PrivateKey privateKey

Constructor Detail

Builderback to summary
public Builder(PrivateKey privateKey, byte[] encapsulation, String algorithmName, int keySizeInBits)

Basic builder.

Parameters
privateKey:PrivateKey

the private key to use to extract the secret from the encapsulation.

encapsulation:byte[]

the encapsulated secret.

algorithmName:String

the algorithm name for the secret key we wish to calculate.

keySizeInBits:int

the size of the key we want to produce in bits.

Builderback to summary
public Builder(PrivateKey privateKey, byte[] encapsulation, String algorithmName, int keySizeInBits, byte[] otherInfo)

Basic builder.

Parameters
privateKey:PrivateKey

the private key to use to extract the secret from the encapsulation.

encapsulation:byte[]

the encapsulated secret.

algorithmName:String

the algorithm name for the secret key we wish to calculate.

keySizeInBits:int

the size of the key we want to produce in bits.

Method Detail

buildback to summary
public KTSExtractKeySpec build()

Build the new key spec.

Returns:KTSExtractKeySpec

a new key spec configured according to the builder state.

withKdfAlgorithmback to summary
public KTSExtractKeySpec.Builder withKdfAlgorithm(FipsKDF.AgreementKDFParametersBuilder kdfAlgorithm)

Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).

Parameters
kdfAlgorithm:FipsKDF.AgreementKDFParametersBuilder

the KDF algorithm to apply.

Returns:KTSExtractKeySpec.Builder

the current Builder instance.

withKdfAlgorithmback to summary
public KTSExtractKeySpec.Builder withKdfAlgorithm(AlgorithmIdentifier kdfAlgorithm)

Set the KDF algorithm and digest algorithm for key generation (ignored for OAEP).

Parameters
kdfAlgorithm:AlgorithmIdentifier

the KDF algorithm to apply.

Returns:KTSExtractKeySpec.Builder

the current Builder instance.

withMacback to summary
public KTSExtractKeySpec.Builder withMac(String macAlgorithmName, int macKeySizeInBits)

Set the MAC algorithm name and its associated key size for the MAC key in the encapsulation.

Parameters
macAlgorithmName:String

name of the MAC algorithm we will use.

macKeySizeInBits:int

size of the MAC key (in bits)

Returns:KTSExtractKeySpec.Builder

the current Builder instance.

withParameterSpecback to summary
public KTSExtractKeySpec.Builder withParameterSpec(AlgorithmParameterSpec parameterSpec)

Set the algorithm parameter spec to be used with the private key.

Parameters
parameterSpec:AlgorithmParameterSpec

the algorithm parameter spec to be used in decryption.

Returns:KTSExtractKeySpec.Builder

the current Builder instance.