Module java.base

Class SM2SignatureParameterSpec

java.lang.Object
java.security.spec.SM2SignatureParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public final class SM2SignatureParameterSpec extends Object implements AlgorithmParameterSpec
The parameters used by SM2 signature.
  • Constructor Details

    • SM2SignatureParameterSpec

      public SM2SignatureParameterSpec(byte[] id, ECPublicKey publicKey)
      Create a new SM2SignatureParameterSpec with ID and public key.
      Parameters:
      id - the ID. it must not longer than 8192-bytes.
      publicKey - the SM2 public key.
      Throws:
      NullPointerException - if publicKey is null.
    • SM2SignatureParameterSpec

      public SM2SignatureParameterSpec(ECPublicKey publicKey)
      Create a new SM2SignatureParameterSpec with public key. It just uses the default ID, exactly 1234567812345678.
      Parameters:
      publicKey - the SM2 public key.
      Throws:
      NullPointerException - if publicKey is null.
  • Method Details

    • getId

      public byte[] getId()
      Returns the ID.
      Returns:
      the ID.
    • getPublicKey

      public ECPublicKey getPublicKey()
      Returns the public key.
      Returns:
      the public key.