Skip navigation links
iaik.security.ssl

Class SupportedEllipticCurves

    • Field Detail

      • TYPE

        public static final ExtensionType TYPE
        The type (10) of the elliptic_curves extension.
      • NC_CHAR2_SECT163K1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT163K1
        Named binary curve sect163k1 (NIST K-163).
        • TLS id: 1
        • OID: 1.3.132.0.1
        • name: sect163k1
      • NC_CHAR2_SECT163R2

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT163R2
        Named binary curve sect163r2 (NIST B-163).
        • TLS id: 3
        • OID: 1.3.132.0.15
        • name: sect163r2
      • NC_CHAR2_SECT233K1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT233K1
        Named binary curve sect233k1 (NIST K-233).
        • TLS id: 6
        • OID: 1.3.132.0.26
        • name: sect233k1
      • NC_CHAR2_SECT233R1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT233R1
        Named binary curve sect233r1 (NIST B-233).
        • TLS id: 7
        • OID: 1.3.132.0.27
        • name: sect233r1
      • NC_CHAR2_SECT283K1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT283K1
        Named binary curve sect283k1 (NIST K-283).
        • TLS id: 9
        • OID: 1.3.132.0.16
        • name: sect283k1
      • NC_CHAR2_SECT283R1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT283R1
        Named binary curve sect283r1 (NIST B-283).
        • TLS id: 10
        • OID: 1.3.132.0.17
        • name: sect283r1
      • NC_CHAR2_SECT409K1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT409K1
        Named binary curve sect409k1 (NIST K-409).
        • TLS id: 11
        • OID: 1.3.132.0.36
        • name: sect409k1
      • NC_CHAR2_SECT409R1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT409R1
        Named binary curve sect409r1 (NIST B-409).
        • TLS id: 12
        • OID: 1.3.132.0.37
        • name: sect409r1
      • NC_CHAR2_SECT571K1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT571K1
        Named binary curve sect571k1 (NIST K-571).
        • TLS id: 13
        • OID: 1.3.132.0.38
        • name: sect571k1
      • NC_CHAR2_SECT571R1

        public static final SupportedEllipticCurves.NamedCurve NC_CHAR2_SECT571R1
        Named binary curve sect571r1 (NIST B-571).
        • TLS id: 14
        • OID: 1.3.132.0.39
        • name: sect571r1
      • NC_PRIME_SECP192R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_SECP192R1
        Named prime curve secp192r1 (NIST P-192, ANSI X9.62 prime192v1).
        • TLS id: 19
        • OID: 1.2.840.10045.3.1.1
        • name: secp192r1
      • NC_PRIME_SECP224R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_SECP224R1
        Named prime curve secp224r1 (NIST P-224).
        • TLS id: 21
        • OID: 1.3.132.0.33
        • name: secp224r1
      • NC_PRIME_SECP256R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_SECP256R1
        Named prime curve secp256r1 (NIST P-256, ANSI X9.62 prime256v1).
        • TLS id: 23
        • OID: 1.2.840.10045.3.1.7
        • name: secp256r1
      • NC_PRIME_SECP384R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_SECP384R1
        Named prime curve secp384r1 (NIST P-384).
        • TLS id: 24
        • OID: 1.3.132.0.34
        • name: secp384r1
      • NC_PRIME_SECP521R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_SECP521R1
        Named prime curve secp521r1 (NIST P-521).
        • TLS id: 25
        • OID: 1.3.132.0.35
        • name: secp521r1
      • NC_ARBITRARY_EXPLICIT_PRIME

        public static final SupportedEllipticCurves.NamedCurve NC_ARBITRARY_EXPLICIT_PRIME
        Deprecated. shall not be used anymore according to RFC 8422
        Named prime curve place holder arbitrary_explicit_prime_curves. Indicates support for arbitrary prime curves (the curve parameters must be encoded explicitly in ECParameters).
        • TLS id: 65281 (0xFF01)
        • OID: -
        • name: arbitrary_explicit_prime_curves
      • NC_ARBITRARY_EXPLICIT_CHAR2

        public static final SupportedEllipticCurves.NamedCurve NC_ARBITRARY_EXPLICIT_CHAR2
        Deprecated. shall not be used anymore according to RFC 8422
        Named binary curve place holder arbitrary_explicit_char2_curves. Indicates support for arbitrary characteristic-2 curves (the curve parameters must be encoded explicitly in ECParameters).
        • TLS id: 65282 (0xFF02)
        • OID: -
        • name: arbitrary_explicit_char2_curves
      • NC_PRIME_BRAINPOOLP256R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_BRAINPOOLP256R1
        Named prime Brainpool curve brainpoolP256r1 (RFC 7027).
        • TLS id: 26
        • OID: 1.3.36.3.3.2.8.1.1.7
        • name: brainpoolP256r1
      • NC_PRIME_BRAINPOOLP384R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_BRAINPOOLP384R1
        Named prime Brainpool curve brainpoolP384r1 (RFC 7027).
        • TLS id: 26
        • OID: 1.3.36.3.3.2.8.1.1.11
        • name: brainpoolP384r1
      • NC_PRIME_BRAINPOOLP512R1

        public static final SupportedEllipticCurves.NamedCurve NC_PRIME_BRAINPOOLP512R1
        Named prime Brainpool curve brainpoolP521r1 (RFC 7027).
        • TLS id: 28
        • OID: 1.3.36.3.3.2.8.1.1.13
        • name: brainpoolP512r1
    • Constructor Detail

      • SupportedEllipticCurves

        public SupportedEllipticCurves()
        Default Constructor. Creates a new SupportedEllipticCurves extension containing -- if cryptographically supported -- secp256r1, secp384r1, secp521r1 and x25519 (in that order) as default elliptic curve list.
        This constructor may be used on the client side if the client wants to use ECC based cipher suites with any of the four elliptic curves secp256r1, secp384r1, secp521r1 or x25519:
         // create SupportedEllipticCurves extension
         SupportedEllipticCurves supportedEllipticCurves = new SupportedEllipticCurves();
         // add to ExtensionList
         ExtensionList extensions = new ExtensionList();
         ...
         extensions.addExtension(supportedEllipticCurves);
         ...
         // set extensions for the SSLClientContext configuration:
         SSLClientContext clientContext = new SSLClientContext();
         ...
         clientContext.setExtensions(extensions);
         ...
         
        On the server side this constructor may be used to indicate support for the SupportedEllipticCurves extension only (the server itself never sends a SupportedEllipticCurves extension):
         // create SupportedEllipticCurves extension
         SupportedEllipticCurves supportedEllipticCurves = new SupportedEllipticCurves();
         // add to ExtensionList
         ExtensionList extensions = new ExtensionList();
         ...
         extensions.addExtension(supportedEllipticCurves);
         ...
         // set extensions for the SSLServerContext configuration:
         SSLServerContext serverContext = new SSLServerContext();
         ...
         serverContext.setExtensions(extensions);
         ...
         
      • SupportedEllipticCurves

        public SupportedEllipticCurves(SupportedEllipticCurves.NamedCurve[] ellipticCurveList)
        Creates a SupportedEllipticCurves extension from the given elliptic curve list.
        This constructor may be used on the client side to specify which elliptic curves the client wants to use with ECC based cipher suites. The elliptic curves shall be listed in preference order. For instance, a client that wants to use secp192r1 (NIST P-192) and secp256r1 (NIST P-256) and prefers secp192r1 will configure the SSLClientContext with the following SupportedEllipticCurves extension:
         // the list of supported elliptic curves
         NamedCurve[] ecList = { SupportedEllipticCurves.NC_PRIME_SECP192R1,
                                 SupportedEllipticCurves.NC_PRIME_SECP256R1 };
         // create SupportedEllipticCurves extension                                 
         SupportedEllipticCurves supportedEllipticCurves = new SupportedEllipticCurves(ecList);
         // add to ExtensionList
         ExtensionList extensions = new ExtensionList();
         ...
         extensions.addExtension(supportedEllipticCurves);
         ...
         // set extensions for the SSLClientContext configuration:
         SSLClientContext clientContext = new SSLClientContext();
         ...
         clientContext.setExtensions(extensions);
         ...
         
        Parameters:
        ellipticCurveList - the list of supported elliptic curves in preference order (the ellipticCurveList array is not cloned or copied by this method)
        Throws:
        java.lang.IllegalArgumentException - if the curve list is empty or any of the given curves is not supported by the installed cryptographic providers
    • Method Detail

      • getRegisteredCurveByName

        public static final SupportedEllipticCurves.NamedCurve getRegisteredCurveByName(java.lang.String name)
        Gets the registered NamedCurve with the given name.
        Parameters:
        name - the name of the curve
        Returns:
        the registered NamedCurve, or null if no curve with the given name is registered
      • getRegisteredCurveByOID

        public static final SupportedEllipticCurves.NamedCurve getRegisteredCurveByOID(java.lang.String oid)
        Gets the registered NamedCurve with the given oid.
        Parameters:
        oid - the oid of the curve
        Returns:
        the registered NamedCurve, or null if no curve with the given oid is registered
      • getRegisteredCurveByID

        public static final SupportedEllipticCurves.NamedCurve getRegisteredCurveByID(int id)
        Gets the registered NamedCurve with the given id.
        Parameters:
        id - the id of the curve
        Returns:
        the registered NamedCurve, or null if no curve with the given id is registered
      • getAllRegisteredNamedCurves

        public static final SupportedEllipticCurves.NamedCurve[] getAllRegisteredNamedCurves()
        Gets all registered named curves.
        Returns:
        an array of all registered named curves.
      • getEllipticCurveList

        public SupportedEllipticCurves.NamedCurve[] getEllipticCurveList()
        Gets the list of supported curves included in this SupportedEllipticCurves extension.
        Returns:
        the list of supported curves (in preference order) as array of NamedCurve objects; the array maybe null or empty if no curves are included in the list (the returned array is not cloned or copied by this method)
      • getCurve

        public SupportedEllipticCurves.NamedCurve getCurve(int id)
        Checks whether the elliptic curve with the given id is included in this SupportedEllipticCurves extension.
        Parameters:
        id - the TLS id of the curve to be checked
        Returns:
        the NamedCurve with the given id if it is included, or null if the curve with the given id is not included
      • setIgnorePeerPreferenceOrder

        public void setIgnorePeerPreferenceOrder(boolean ignore)
        Whether to ignore the preference order of the curve list sent by the peer (client) when selecting a curve for the current session. By default the curve is selected according to the preference order sent by the client.
        This method is only meaningful on the server side since an elliptic_curve extension can only be sent by the client.
        Parameters:
        ignore - whether to ignore the peer (client) curve list preference order when selecting the curve for the current session
      • clone

        public java.lang.Object clone()
        Returns a clone of this SupportedEllipticCurves extension object.
        Overrides:
        clone in class Extension
        Returns:
        a clone of this SupportedEllipticCurves extension object
      • toString

        public java.lang.String toString()
        Gets a String representation of this SupportedEllipticCurves object.
        Specified by:
        toString in class Extension
        Returns:
        a String representation of the SupportedEllipticCurves object
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.1, (c) 2002 IAIK, (c) 2003 - 2015 SIC