PLValidateSM2Identity

Cryptography, digital signatures

Description

Checks that an SM2 private scalar belongs to a certificate and extracts the 32-byte scalar for the pure-Pascal signing path

The certificate must carry an SM2 public key and the private key must be the PKCS#8 form whose embedded scalar derives that public key

Syntax

Delphi

Function PLValidateSM2Identity(Const CertificateDER, PrivateKeyDER: AnsiString;
  Out PrivateKeyScalar: AnsiString): Boolean;

Parameters

CertificateDERDER-encoded certificate holding the SM2 public key
PrivateKeyDERDER-encoded PKCS#8 private key
PrivateKeyScalarReceives the 32-byte scalar; empty on failure

Return values

FalseThe pair does not match, is not SM2, or the encodings are malformed
TruePrivateKeyScalar holds 32 bytes usable with PLSM2Sign

Remarks

This is the identity gate behind SetSignProcessSM2Identity; passing validation means the signing process can pair the SM2-with-SM3 algorithm identifier without CNG

See also

SetSignProcessSM2Identity, PLSM2Sign, PLSM2PublicKeyFromPrivate, PLValidateEd25519Identity