Package org.bouncycastle.jcajce.spec
Class DHUParameterSpec
java.lang.Object
org.bouncycastle.jcajce.spec.DHUParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
Parameter spec to provide Diffie-Hellman Unified model keys and user keying material.
-
Constructor Summary
ConstructorsConstructorDescriptionDHUParameterSpec
(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey) Base constructor for a Diffie-Hellman unified model using a key pair without user keying material.DHUParameterSpec
(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model using a key pair.DHUParameterSpec
(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey) Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required and no user keying material is provided.DHUParameterSpec
(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required.DHUParameterSpec
(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec) Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required.DHUParameterSpec
(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey) Base constructor for a Diffie-Hellman unified model without user keying material.DHUParameterSpec
(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model.DHUParameterSpec
(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec) Base constructor for a Diffie-Hellman unified model. -
Method Summary
Modifier and TypeMethodDescriptionReturn our ephemeral private key.Return our ephemeral public key, null if it was not provided.Return the AlgorithmParameterSpec for the KDF used to derive the final secret key.Return the ephemeral other party public key.byte[]
Return the user keying material for the KDF used to derive the final secret key.
-
Constructor Details
-
DHUParameterSpec
public DHUParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec) Base constructor for a Diffie-Hellman unified model.- Parameters:
ephemeralPublicKey
- our ephemeral public key.ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.kdfParameterSpec
- parameter spec for key generator to mix with the calculated secret.
-
DHUParameterSpec
public DHUParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model.- Parameters:
ephemeralPublicKey
- our ephemeral public key.ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.userKeyingMaterial
- key generation material to mix with the calculated secret.
-
DHUParameterSpec
public DHUParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey) Base constructor for a Diffie-Hellman unified model without user keying material.- Parameters:
ephemeralPublicKey
- our ephemeral public key.ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.
-
DHUParameterSpec
public DHUParameterSpec(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model using a key pair.- Parameters:
ephemeralKeyPair
- our ephemeral public and private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.userKeyingMaterial
- key generation material to mix with the calculated secret.
-
DHUParameterSpec
public DHUParameterSpec(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial) Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required.- Parameters:
ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.userKeyingMaterial
- key generation material to mix with the calculated secret.
-
DHUParameterSpec
public DHUParameterSpec(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec) Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required.- Parameters:
ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.kdfParameterSpec
- parameter spec for key generator to mix with the calculated secret.
-
DHUParameterSpec
Base constructor for a Diffie-Hellman unified model using a key pair without user keying material.- Parameters:
ephemeralKeyPair
- our ephemeral public and private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.
-
DHUParameterSpec
Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required and no user keying material is provided.- Parameters:
ephemeralPrivateKey
- our ephemeral private key.otherPartyEphemeralKey
- the ephemeral public key sent by the other party.
-
-
Method Details
-
getEphemeralPrivateKey
Return our ephemeral private key.- Returns:
- our ephemeral private key.
-
getEphemeralPublicKey
Return our ephemeral public key, null if it was not provided.- Returns:
- our ephemeral public key, can be null.
-
getOtherPartyEphemeralKey
Return the ephemeral other party public key.- Returns:
- the ephemeral other party public key.
-
getUserKeyingMaterial
public byte[] getUserKeyingMaterial()Return the user keying material for the KDF used to derive the final secret key.- Returns:
- the user keying material to be input into the KDF.
-
getKdfParameterSpec
Return the AlgorithmParameterSpec for the KDF used to derive the final secret key.- Returns:
- the AlgorithmsParameterSpec to be passed to the KDF.
-