Class MQVParameterSpec

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

public class MQVParameterSpec extends Object implements AlgorithmParameterSpec
Parameter spec to provide MQV ephemeral keys and user keying material.
  • Constructor Details

    • MQVParameterSpec

      public MQVParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec)
      Base constructor.
      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.
    • MQVParameterSpec

      public MQVParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)
      Base constructor.
      Parameters:
      ephemeralPublicKey - our ephemeral public key.
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the other party's ephemeral public key.
      userKeyingMaterial - the user keying material for the key derivation function.
    • MQVParameterSpec

      public MQVParameterSpec(PublicKey ephemeralPublicKey, PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey)
      Constructor without user keying material.
      Parameters:
      ephemeralPublicKey - our ephemeral public key.
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the other party's ephemeral public key.
    • MQVParameterSpec

      public MQVParameterSpec(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)
      Constructor taking an ephemeral key pair.
      Parameters:
      ephemeralKeyPair - keypair holding our ephemeral public and private keys.
      otherPartyEphemeralKey - the other party's ephemeral public key.
      userKeyingMaterial - the user keying material for the key derivation function.
    • MQVParameterSpec

      public MQVParameterSpec(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec)
      Constructor taking an ephemeral key pair and an algorithm spec.
      Parameters:
      ephemeralKeyPair - keypair holding our ephemeral public and private keys.
      otherPartyEphemeralKey - the other party's ephemeral public key.
      kdfParameterSpec - parameter spec for key generator to mix with the calculated secret.
    • MQVParameterSpec

      public MQVParameterSpec(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, byte[] userKeyingMaterial)
      Constructor without our ephemeral public key - in this case it is assumed the ephemeral public key can be calculated later.
      Parameters:
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the other party's ephemeral public key.
      userKeyingMaterial - the user keying material for the key derivation function.
    • MQVParameterSpec

      public MQVParameterSpec(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey, AlgorithmParameterSpec kdfParameterSpec)
      Constructor without our ephemeral public key - in this case it is assumed the ephemeral public key can be calculated later.
      Parameters:
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the other party's ephemeral public key.
      kdfParameterSpec - parameter spec for key generator to mix with the calculated secret.
    • MQVParameterSpec

      public MQVParameterSpec(KeyPair ephemeralKeyPair, PublicKey otherPartyEphemeralKey)
      Constructor taking an ephemeral key pair without user keying material.
      Parameters:
      ephemeralKeyPair - keypair holding our ephemeral public and private keys.
      otherPartyEphemeralKey - the other party's ephemeral public key.
    • MQVParameterSpec

      public MQVParameterSpec(PrivateKey ephemeralPrivateKey, PublicKey otherPartyEphemeralKey)
      Constructor without our ephemeral public key or user keying material - in this case it is assumed the ephemeral public key can be calculated later.
      Parameters:
      ephemeralPrivateKey - our ephemeral private key.
      otherPartyEphemeralKey - the other party's ephemeral public key.
  • 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, if available.
      Returns:
      the ephemeral public key, may be null.
    • getOtherPartyEphemeralKey

      public PublicKey getOtherPartyEphemeralKey()
      Return the other party's ephemeral public key.
      Returns:
      the other party's 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

      public AlgorithmParameterSpec getKdfParameterSpec()
      Return the AlgorithmParameterSpec for the KDF used to derive the final secret key.
      Returns:
      the AlgorithmsParameterSpec to be passed to the KDF.