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

public Class KTSParameterSpec

extends KEMKDFSpec
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 AlgorithmParameterSpec

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 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 org.bouncycastle.jcajce.spec.KEMKDFSpec:
getKdfAlgorithmgetKeyAlgorithmNamegetKeySizegetOtherInfo

Field Detail

parameterSpecback to summary
private final AlgorithmParameterSpec parameterSpec

Constructor Detail

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

Method Detail

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.