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
ConstructorDescriptionDHUParameterSpec
(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
(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. -
Method Summary
Modifier and TypeMethodDescriptionReturn our ephemeral private key.Return our ephemeral public key, null if it was not provided.Return the ephemeral other party public key.byte[]
Return a copy of the user keying material, null if none is available.
-
Constructor Details
-
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
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 a copy of the user keying material, null if none is available.- Returns:
- a copy of the user keying material, can be null.
-