corePKCS11  v3.2.0
PKCS #11 Cryptoki Library
PKI_mbedTLSSignatureToPkcs11Signature

Converts an ECDSA P-256 signature from the format provided by mbedTLS to the format expected by PKCS #11.

int8_t PKI_pkcs11SignatureTombedTLSSignature( uint8_t * pucSig,
size_t * pxSigLen );

For P-256 signatures, PKCS #11 expects a 64 byte signature, in the format of 32 byte R component followed by 32 byte S component.

mbedTLS provides signatures in DER encoded, zero-padded format.

Parameters
[out]pxSignaturePKCSPointer to a 64 byte buffer where PKCS #11 formatted signature will be placed. Caller must allocate 64 bytes of memory.
[in]pxMbedSignaturePointer to DER encoded ECDSA signature. Buffer size is expected to be 72 bytes.
Returns
0 on success, -1 on failure.
PKI_pkcs11SignatureTombedTLSSignature
int8_t PKI_pkcs11SignatureTombedTLSSignature(uint8_t *pucSig, size_t *pxSigLen)
Converts and ECDSA P-256 signature from the format provided by PKCS #11 to an ASN....
Definition: core_pki_utils.c:131