Class KeyExchangeBase

  • All Implemented Interfaces:
    KeyExchange
    Direct Known Subclasses:
    AbstractDH

    public abstract class KeyExchangeBase
    extends java.lang.Object
    implements KeyExchange
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Digest digest  
      protected byte[] H  
      protected java.security.PublicKey hostKey  
      private byte[] I_C  
      private byte[] I_S  
      protected Transport trans  
      private java.lang.String V_C  
      private java.lang.String V_S  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getH()  
      Digest getHash()
      The message digest used by this key exchange algorithm.
      java.security.PublicKey getHostKey()  
      void init​(Transport trans, java.lang.String V_S, java.lang.String V_C, byte[] I_S, byte[] I_C)
      Initialize the key exchange algorithm.
      protected Buffer.PlainBuffer initializedBuffer()  
      • Methods inherited from class java.lang.Object

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

      • digest

        protected final Digest digest
      • H

        protected byte[] H
      • hostKey

        protected java.security.PublicKey hostKey
      • V_S

        private java.lang.String V_S
      • V_C

        private java.lang.String V_C
      • I_S

        private byte[] I_S
      • I_C

        private byte[] I_C
    • Constructor Detail

      • KeyExchangeBase

        public KeyExchangeBase​(Digest digest)
    • Method Detail

      • init

        public void init​(Transport trans,
                         java.lang.String V_S,
                         java.lang.String V_C,
                         byte[] I_S,
                         byte[] I_C)
                  throws java.security.GeneralSecurityException,
                         TransportException
        Description copied from interface: KeyExchange
        Initialize the key exchange algorithm.
        Specified by:
        init in interface KeyExchange
        Parameters:
        trans - the transport
        V_S - the server identification string
        V_C - the client identification string
        I_S - the server key init packet
        I_C - the client key init packet
        Throws:
        java.security.GeneralSecurityException
        TransportException - if there is an error sending a packet
      • getH

        public byte[] getH()
        Specified by:
        getH in interface KeyExchange
        Returns:
        the computed H parameter
      • getHash

        public Digest getHash()
        Description copied from interface: KeyExchange
        The message digest used by this key exchange algorithm.
        Specified by:
        getHash in interface KeyExchange
        Returns:
        the message digest
      • getHostKey

        public java.security.PublicKey getHostKey()
        Specified by:
        getHostKey in interface KeyExchange
        Returns:
        the host key determined from server's response packets