Class XDH


  • public class XDH
    extends AbstractDH
    Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.
    See Also:
    RFC 8731
    • Constructor Detail

      • XDH

        public XDH​(MontgomeryCurve curve)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • calculateE

        protected byte[] calculateE()
                             throws java.lang.Exception
        Description copied from class: AbstractDH
        Lazy-called by AbstractDH.getE() if the public key data has not been generated yet.
        Specified by:
        calculateE in class AbstractDH
        Returns:
        The calculated public key data
        Throws:
        java.lang.Exception - If failed to generate the relevant data
      • setF

        public void setF​(byte[] f)
        Specified by:
        setF in class AbstractDH
      • calculateK

        protected byte[] calculateK()
                             throws java.lang.Exception
        Description copied from class: AbstractDH
        Lazy-called by AbstractDH.getK() if the shared secret data has not been calculated yet
        Specified by:
        calculateK in class AbstractDH
        Returns:
        The shared secret data
        Throws:
        java.lang.Exception - If failed to calculate it
      • getHash

        public Digest getHash()
                       throws java.lang.Exception
        Specified by:
        getHash in class AbstractDH
        Throws:
        java.lang.Exception