Package org.bouncycastle.jcajce.spec
Class DHUParameterSpec
- java.lang.Object
-
- org.bouncycastle.jcajce.spec.DHUParameterSpec
-
- All Implemented Interfaces:
java.security.spec.AlgorithmParameterSpec
public class DHUParameterSpec extends java.lang.Object implements java.security.spec.AlgorithmParameterSpecParameter spec to provide Diffie-Hellman Unified model keys and user keying material.
-
-
Constructor Summary
Constructors Constructor Description DHUParameterSpec(java.security.KeyPair ephemeralKeyPair, java.security.PublicKey otherPartyEphemeralKey)Base constructor for a Diffie-Hellman unified model using a key pair without user keying material.DHUParameterSpec(java.security.KeyPair ephemeralKeyPair, java.security.PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)Base constructor for a Diffie-Hellman unified model using a key pair.DHUParameterSpec(java.security.PrivateKey ephemeralPrivateKey, java.security.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(java.security.PrivateKey ephemeralPrivateKey, java.security.PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)Base constructor for a Diffie-Hellman unified model - calculation of our ephemeral public key is required.DHUParameterSpec(java.security.PublicKey ephemeralPublicKey, java.security.PrivateKey ephemeralPrivateKey, java.security.PublicKey otherPartyEphemeralKey)Base constructor for a Diffie-Hellman unified model without user keying material.DHUParameterSpec(java.security.PublicKey ephemeralPublicKey, java.security.PrivateKey ephemeralPrivateKey, java.security.PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)Base constructor for a Diffie-Hellman unified model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.PrivateKeygetEphemeralPrivateKey()Return our ephemeral private key.java.security.PublicKeygetEphemeralPublicKey()Return our ephemeral public key, null if it was not provided.java.security.PublicKeygetOtherPartyEphemeralKey()Return the ephemeral other party public key.byte[]getUserKeyingMaterial()Return a copy of the user keying material, null if none is available.
-
-
-
Constructor Detail
-
DHUParameterSpec
public DHUParameterSpec(java.security.PublicKey ephemeralPublicKey, java.security.PrivateKey ephemeralPrivateKey, java.security.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(java.security.PublicKey ephemeralPublicKey, java.security.PrivateKey ephemeralPrivateKey, java.security.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(java.security.KeyPair ephemeralKeyPair, java.security.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(java.security.PrivateKey ephemeralPrivateKey, java.security.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(java.security.KeyPair ephemeralKeyPair, java.security.PublicKey otherPartyEphemeralKey)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
public DHUParameterSpec(java.security.PrivateKey ephemeralPrivateKey, java.security.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.- Parameters:
ephemeralPrivateKey- our ephemeral private key.otherPartyEphemeralKey- the ephemeral public key sent by the other party.
-
-
Method Detail
-
getEphemeralPrivateKey
public java.security.PrivateKey getEphemeralPrivateKey()
Return our ephemeral private key.- Returns:
- our ephemeral private key.
-
getEphemeralPublicKey
public java.security.PublicKey getEphemeralPublicKey()
Return our ephemeral public key, null if it was not provided.- Returns:
- our ephemeral public key, can be null.
-
getOtherPartyEphemeralKey
public java.security.PublicKey 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.
-
-