Module java.base

Class SM2ParameterSpec

java.lang.Object
java.security.spec.ECParameterSpec
java.security.spec.SM2ParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public final class SM2ParameterSpec extends ECParameterSpec
The EC domain parameters used by SM2. The parameters are defined by China's specification GB/T 32918.5-2017.
  • Field Details

    • CURVE

      public static final EllipticCurve CURVE
      The SM2 elliptic curve.
    • GENERATOR

      public static final ECPoint GENERATOR
      The generator or base point.
    • ORDER

      public static final BigInteger ORDER
      The order of the generator.
    • COFACTOR

      public static final BigInteger COFACTOR
      The cofactor.
    • OID

      public static final String OID
      The OID of the SM2 elliptic curve.
      See Also:
  • Method Details

    • instance

      public static SM2ParameterSpec instance()
      Returns a singleton of SM2ParameterSpec.
      Returns:
      the singleton.
    • isCurveSM2

      public static boolean isCurveSM2(byte[] encodedOid)
      Indicates if the encoded OID is SM2 elliptic curve.
      Parameters:
      encodedOid - the encoded OID.
      Returns:
      true if the encoded OID is SM2 elliptic curve; otherwise false.
    • isCurveSM2

      public static boolean isCurveSM2(String oid)
      Indicates if the OID is SM2 elliptic curve.
      Parameters:
      oid - the encoded OID.
      Returns:
      true if the OID is SM2 elliptic curve; otherwise false.