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

public Class KEMExtractSpec

extends KEMKDFSpec
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.security.PrivateKey, java.security.spec.AlgorithmParameterSpec, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.util.Arrays

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
KEMExtractSpec.Builder

Builder class for creating a KEMExtractSpec.

Field Summary

Modifier and TypeField and Description
private static AlgorithmIdentifier
private static final byte[]
private final byte[]
private final PrivateKey

Constructor Summary

AccessConstructor and Description
private
KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName, int keySizeInBits, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)

public
KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName)

public
KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName, int keySizeInBits)

Method Summary

Modifier and TypeMethod and Description
public byte[]
public PrivateKey
Inherited from org.bouncycastle.jcajce.spec.KEMKDFSpec:
getKdfAlgorithmgetKeyAlgorithmNamegetKeySizegetOtherInfo

Field Detail

DefKdfback to summary
private static AlgorithmIdentifier DefKdf
EMPTY_OTHER_INFOback to summary
private static final byte[] EMPTY_OTHER_INFO
encapsulationback to summary
private final byte[] encapsulation
privateKeyback to summary
private final PrivateKey privateKey

Constructor Detail

KEMExtractSpecback to summary
private KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName, int keySizeInBits, AlgorithmIdentifier kdfAlgorithm, byte[] otherInfo)
KEMExtractSpecback to summary
public KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName)
KEMExtractSpecback to summary
public KEMExtractSpec(PrivateKey privateKey, byte[] encapsulation, String keyAlgorithmName, int keySizeInBits)

Method Detail

getEncapsulationback to summary
public byte[] getEncapsulation()
getPrivateKeyback to summary
public PrivateKey getPrivateKey()
org.bouncycastle.jcajce.spec back to summary

public final Class KEMExtractSpec.Builder

extends Object
Class Inheritance

Builder class for creating a KEMExtractSpec.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Builder(PrivateKey
the private key to use for the secret extraction.
privateKey
,
byte[]
the encapsulation to process.
encapsulation
,
String
the algorithm name for the secret key we want to generate.
keyAlgorithmName
,
int
the size of the wrapping key we want to produce in bits.
keySizeInBits
)

Basic builder.

Method Summary

Modifier and TypeMethod and Description
public KEMExtractSpec

Returns:

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

Build the new parameter spec.

public KEMExtractSpec.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 KEMExtractSpec.Builder

Returns:

the current Builder instance.
withNoKdf
()

Use the shared secret directly for key wrap generation.

public KEMExtractSpec.Builder

Returns:

the current Builder instance.
withOtherInfo
(byte[]
the other info to use.
otherInfo
)

Set the OtherInfo to use with the KDF.

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
otherInfoback to summary
private byte[] otherInfo
privateKeyback to summary
private final PrivateKey privateKey

Constructor Detail

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

Basic builder.

Parameters
privateKey:PrivateKey

the private key to use for the secret extraction.

encapsulation:byte[]

the encapsulation to process.

keyAlgorithmName:String

the algorithm name for the secret key we want to generate.

keySizeInBits:int

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

Method Detail

buildback to summary
public KEMExtractSpec build()

Build the new parameter spec.

Returns:KEMExtractSpec

a new parameter spec configured according to the builder state.

withKdfAlgorithmback to summary
public KEMExtractSpec.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:KEMExtractSpec.Builder

the current Builder instance.

withNoKdfback to summary
public KEMExtractSpec.Builder withNoKdf()

Use the shared secret directly for key wrap generation.

Returns:KEMExtractSpec.Builder

the current Builder instance.

withOtherInfoback to summary
public KEMExtractSpec.Builder withOtherInfo(byte[] otherInfo)

Set the OtherInfo to use with the KDF. The default OtherInfo is a zero length byte[].

Parameters
otherInfo:byte[]

the other info to use.

Returns:KEMExtractSpec.Builder

the current Builder instance.