Class DHUParameterSpec

java.lang.Object
org.bouncycastle.jcajce.spec.DHUParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class DHUParameterSpec extends Object implements AlgorithmParameterSpec
Parameter spec to provide Diffie-Hellman Unified model keys and user keying material.
  • 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

      public DHUParameterSpec(KeyPair ephemeralKeyPair, 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(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.
      Parameters:
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the ephemeral public key sent by the other party.
  • Method Details

    • getEphemeralPrivateKey

      public PrivateKey getEphemeralPrivateKey()
      Return our ephemeral private key.
      Returns:
      our ephemeral private key.
    • getEphemeralPublicKey

      public PublicKey getEphemeralPublicKey()
      Return our ephemeral public key, null if it was not provided.
      Returns:
      our ephemeral public key, can be null.
    • getOtherPartyEphemeralKey

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