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

public Class KTSParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Known Direct Subclasses
org.bouncycastle.jcajce.spec.KEMParameterSpec
Imports
java.security.spec.AlgorithmParameterSpec, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.util.Arrays

Parameter spec for doing KTS based wrapping via the Cipher API.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
KTSParameterSpec.Builder

Builder class for creating a KTSParameterSpec.

Field Summary

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

Constructor Summary

AccessConstructor and Description
protected
KTSParameterSpec(String wrappingKeyAlgorithm, int keySizeInBits, AlgorithmParameterSpec parameterSpec, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)

Method Summary

Modifier and TypeMethod and Description
public AlgorithmIdentifier

Returns:

the AlgorithmIdentifier for the SecretKeyFactory's KDF.
getKdfAlgorithm
()

Return the AlgorithmIdentifier for the KDF to do key derivation after extracting the secret.

public String

Returns:

the key algorithm.
getKeyAlgorithmName
()

Return the name of the algorithm for the wrapping key this key spec should use.

public int

Returns:

length in bits of the key to be calculated.
getKeySize
()

Return the size of the key (in bits) for the wrapping key this key spec should use.

public byte[]

Returns:

the otherInfo data.
getOtherInfo
()

Return the otherInfo data for initialising the KDF.

public AlgorithmParameterSpec

Returns:

the algorithm parameter spec to be used with the private key.
getParameterSpec
()

Return the algorithm parameter spec to be applied with the private key when the encapsulation is decrypted.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

kdfAlgorithmback to summary
private final AlgorithmIdentifier kdfAlgorithm
keySizeInBitsback to summary
private final int keySizeInBits
otherInfoback to summary
private byte[] otherInfo
parameterSpecback to summary
private final AlgorithmParameterSpec parameterSpec
wrappingKeyAlgorithmback to summary
private final String wrappingKeyAlgorithm

Constructor Detail

KTSParameterSpecback to summary
protected KTSParameterSpec(String wrappingKeyAlgorithm, int keySizeInBits, AlgorithmParameterSpec parameterSpec, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)

Method Detail

getKdfAlgorithmback to summary
public AlgorithmIdentifier getKdfAlgorithm()

Return the AlgorithmIdentifier for the KDF to do key derivation after extracting the secret.

Returns:AlgorithmIdentifier

the AlgorithmIdentifier for the SecretKeyFactory's KDF.

getKeyAlgorithmNameback to summary
public String getKeyAlgorithmName()

Return the name of the algorithm for the wrapping key this key spec should use.

Returns:String

the key algorithm.

getKeySizeback to summary
public int getKeySize()

Return the size of the key (in bits) for the wrapping key this key spec should use.

Returns:int

length in bits of the key to be calculated.

getOtherInfoback to summary
public byte[] getOtherInfo()

Return the otherInfo data for initialising the KDF.

Returns:byte[]

the otherInfo data.

getParameterSpecback to summary
public AlgorithmParameterSpec getParameterSpec()

Return the algorithm parameter spec to be applied with the private key when the encapsulation is decrypted.

Returns:AlgorithmParameterSpec

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

org.bouncycastle.jcajce.spec back to summary

public final Class KTSParameterSpec.Builder

extends Object
Class Inheritance

Builder class for creating a KTSParameterSpec.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Builder(String
the algorithm name for the secret key we use for wrapping.
algorithmName
,
int
the size of the wrapping key we want to produce in bits.
keySizeInBits
)

Basic builder.

public
Builder(String
the algorithm name for the secret key we use for wrapping.
algorithmName
,
int
the size of the wrapping key we want to produce in bits.
keySizeInBits
,
byte[]
the otherInfo/IV encoding to be applied to the KDF.
otherInfo
)

Basic builder.

Method Summary

Modifier and TypeMethod and Description
public KTSParameterSpec

Returns:

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

Build the new parameter spec.

public KTSParameterSpec.Builder

Returns:

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

Set the KDF algorithm and digest algorithm for wrap key generation.

public KTSParameterSpec.Builder

Returns:

the current Builder instance.
withNoKdf
()

Use the shared secret directly for key wrap generation.

public KTSParameterSpec.Builder

Returns:

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

Set the algorithm parameter spec to be used with the wrapper.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmNameback to summary
private final String algorithmName
kdfAlgorithmback to summary
private AlgorithmIdentifier kdfAlgorithm
keySizeInBitsback to summary
private final int keySizeInBits
otherInfoback to summary
private byte[] otherInfo
parameterSpecback to summary
private AlgorithmParameterSpec parameterSpec

Constructor Detail

Builderback to summary
public Builder(String algorithmName, int keySizeInBits)

Basic builder.

Parameters
algorithmName:String

the algorithm name for the secret key we use for wrapping.

keySizeInBits:int

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

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

Basic builder.

Parameters
algorithmName:String

the algorithm name for the secret key we use for wrapping.

keySizeInBits:int

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

otherInfo:byte[]

the otherInfo/IV encoding to be applied to the KDF.

Method Detail

buildback to summary
public KTSParameterSpec build()

Build the new parameter spec.

Returns:KTSParameterSpec

a new parameter spec configured according to the builder state.

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

Set the KDF algorithm and digest algorithm for wrap key generation. The default KDF is X9.44 KDF-3, also known as the NIST concatenation KDF.

Parameters
kdfAlgorithm:AlgorithmIdentifier

the KDF algorithm to apply.

Returns:KTSParameterSpec.Builder

the current Builder instance.

withNoKdfback to summary
public KTSParameterSpec.Builder withNoKdf()

Use the shared secret directly for key wrap generation.

Returns:KTSParameterSpec.Builder

the current Builder instance.

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

Set the algorithm parameter spec to be used with the wrapper.

Parameters
parameterSpec:AlgorithmParameterSpec

the algorithm parameter spec to be used in wrapping/unwrapping.

Returns:KTSParameterSpec.Builder

the current Builder instance.