Class DhExchange


  • public class DhExchange
    extends java.lang.Object
    DhExchange.
    Version:
    $Id: DhExchange.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.math.BigInteger e  
      (package private) java.math.BigInteger f  
      (package private) static java.math.BigInteger g  
      private java.lang.String hashAlgorithm  
      (package private) java.math.BigInteger k  
      private static Logger log  
      (package private) java.math.BigInteger p  
      (package private) static java.math.BigInteger p1  
      (package private) static java.math.BigInteger p14  
      (package private) java.math.BigInteger x  
    • Constructor Summary

      Constructors 
      Constructor Description
      DhExchange()
      Deprecated.
      DhExchange​(java.lang.String hashAlgorightm)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] calculateH​(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey)  
      java.math.BigInteger getE()  
      java.lang.String getHashAlgorithm()  
      java.math.BigInteger getK()  
      void init​(int group, java.security.SecureRandom rnd)  
      void setF​(java.math.BigInteger f)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private static final Logger log
      • p1

        static final java.math.BigInteger p1
      • p14

        static final java.math.BigInteger p14
      • g

        static final java.math.BigInteger g
      • p

        java.math.BigInteger p
      • e

        java.math.BigInteger e
      • x

        java.math.BigInteger x
      • f

        java.math.BigInteger f
      • k

        java.math.BigInteger k
      • hashAlgorithm

        private final java.lang.String hashAlgorithm
    • Constructor Detail

      • DhExchange

        @Deprecated
        public DhExchange()
        Deprecated.
      • DhExchange

        public DhExchange​(java.lang.String hashAlgorightm)
    • Method Detail

      • init

        public void init​(int group,
                         java.security.SecureRandom rnd)
      • getE

        public java.math.BigInteger getE()
        Returns:
        Returns the e.
      • getK

        public java.math.BigInteger getK()
        Returns:
        Returns the shared secret k.
      • setF

        public void setF​(java.math.BigInteger f)
        Parameters:
        f - f
      • calculateH

        public byte[] calculateH​(byte[] clientversion,
                                 byte[] serverversion,
                                 byte[] clientKexPayload,
                                 byte[] serverKexPayload,
                                 byte[] hostKey)
                          throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • getHashAlgorithm

        public java.lang.String getHashAlgorithm()