Class ECDH


  • public class ECDH
    extends AbstractDH
    Elliptic Curve Diffie-Hellman key agreement.
    • Field Detail

      • params

        private java.security.spec.ECParameterSpec params
      • f

        private java.security.spec.ECPoint f
    • Constructor Detail

      • ECDH

        public ECDH()
             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ECDH

        public ECDH​(java.lang.String curveName)
             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ECDH

        public ECDH​(ECCurves curve)
             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ECDH

        public ECDH​(java.security.spec.ECParameterSpec paramSpec)
             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
      • 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
      • setCurveParameters

        public void setCurveParameters​(java.security.spec.ECParameterSpec paramSpec)
      • setF

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

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