Class BcTlsDHDomain

java.lang.Object
org.bouncycastle.tls.crypto.impl.bc.BcTlsDHDomain
All Implemented Interfaces:
TlsDHDomain

public class BcTlsDHDomain extends Object implements TlsDHDomain
BC light-weight support class for Diffie-Hellman key pair generation and key agreement over a specified Diffie-Hellman configuration.
  • Field Details

    • crypto

      protected BcTlsCrypto crypto
    • config

      protected TlsDHConfig config
    • domainParameters

      protected org.bouncycastle.crypto.params.DHParameters domainParameters
  • Constructor Details

  • Method Details

    • calculateDHAgreement

      public static BcTlsSecret calculateDHAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey, boolean padded)
    • getDomainParameters

      public static org.bouncycastle.crypto.params.DHParameters getDomainParameters(TlsDHConfig dhConfig)
    • calculateDHAgreement

      public BcTlsSecret calculateDHAgreement(org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey)
    • createDH

      public TlsAgreement createDH()
      Description copied from interface: TlsDHDomain
      Return an agreement operator suitable for ephemeral Diffie-Hellman.
      Specified by:
      createDH in interface TlsDHDomain
      Returns:
      a key agreement operator.
    • decodeParameter

      public BigInteger decodeParameter(byte[] encoding) throws IOException
      Throws:
      IOException
    • decodePublicKey

      public org.bouncycastle.crypto.params.DHPublicKeyParameters decodePublicKey(byte[] encoding) throws IOException
      Throws:
      IOException
    • encodeParameter

      public byte[] encodeParameter(BigInteger x)
    • encodePublicKey

      public byte[] encodePublicKey(org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey)
    • generateKeyPair

      public org.bouncycastle.crypto.AsymmetricCipherKeyPair generateKeyPair()