PLVerifySignedDERPure

Cryptography, digital signatures

Description

Verifies a DER-encoded signed value against the public key of a DER-encoded signer certificate without any system crypto provider

The signed value must be a SEQUENCE holding the signed bytes as a nested SEQUENCE, an AlgorithmIdentifier, the signature as an OCTET STRING with zero unused bits and, optionally, one trailing [0] element

Syntax

Delphi

Function PLVerifySignedDERPure(Const SignedDER,
  SignerCertificateDER: AnsiString): Boolean;

Parameters

SignedDERThe DER signed value: signed bytes, signature algorithm and signature value
SignerCertificateDERDER certificate whose SubjectPublicKeyInfo supplies the verification key and key algorithm

Return values

TrueThe signature verifies against the certificate key
FalseAn input is empty or malformed, the structure deviates from the expected layout, the signature algorithm is not supported, or the verification fails

Remarks

The outer SEQUENCE must end exactly at the end of the input; trailing bytes after the optional [0] element are rejected

Recognised signature algorithms are Ed25519, Ed448, SM2 with SM3, ML-DSA-44, ML-DSA-65, ML-DSA-87, RSASSA-PSS, and RSA or ECDSA with SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-384 and SHA3-512

RSA and ECDSA signatures are accepted only when the signature algorithm matches the key type in the certificate

See also

PLVerifyCertificatePathPure, PLVerifyECDSAPure, PLVerifyRSAPKCS1Pure, PLVerifyRSAPSSPure, PLCertificatePublicKeyInfo