corePKCS11  v3.2.0
PKCS #11 Cryptoki Library
PKI_pkcs11SignatureTombedTLSSignature

Converts and ECDSA P-256 signature from the format provided by PKCS #11 to an ASN.1 formatted signature.

int8_t PKI_mbedTLSSignatureToPkcs11Signature( uint8_t * pxSignaturePKCS,
const uint8_t * pxMbedSignature );

For P-256 signature, ASN.1 formatting has the format

SEQUENCE LENGTH INTEGER LENGTH R-VALUE INTEGER LENGTH S-VALUE

Parameters
[in,out]pucSigThis pointer serves dual purpose. It should both contain the 64-byte PKCS #11 style signature on input, and will be modified to hold the ASN.1 formatted signature (max length 72 bytes). It is the responsibility of the caller to guarantee that this pointer is large enough to hold the (longer) formatted signature.
[out]pxSigLenPointer to the length of the ASN.1 formatted signature.
Returns
0 if successful, -1 on failure.
PKI_mbedTLSSignatureToPkcs11Signature
int8_t PKI_mbedTLSSignatureToPkcs11Signature(uint8_t *pxSignaturePKCS, const uint8_t *pxMbedSignature)
Converts an ECDSA P-256 signature from the format provided by mbedTLS to the format expected by PKCS ...
Definition: core_pki_utils.c:43