mbed/COMPONENT_AWSIOT_PKCS11PSA/corePKCS11/core_pki_utils.c
/* Convert an EC signature from PKCS #11 format to DER encoded. */
/* @[declare pkcs11_utils_pkimbedtlssignaturetopkcs11signature] */
Convert an EC signature from PKCS #11 format to DER encoded.
Convert an EC signature from PKCS #11 format to DER encoded .
int8_t PKI_pkcs11SignatureTombedTLSSignature( uint8_t * pucSig,
                                              size_t * pxSigLen,
                                              size_t xSigMaxLen )
{
    int8_t xReturn = 0;
    if( ( pucSig == NULL ) || ( pxSigLen == NULL ) )
    {
        xReturn = FAILURE;
    }
    if( xReturn == 0 )
    {
        int rc_mbedtls = 0;
        rc_mbedtls = pk_ecdsa_sig_asn1_from_psa((unsigned char *) pucSig,
                                                pxSigLen,
                                                xSigMaxLen);
        if (0 != rc_mbedtls) {
            printf("extract_ecdsa_sig failed: %d\r\n", rc_mbedtls);
            xReturn = FAILURE;
        }
    }
    return xReturn;
}
int8_t PKI_pkcs11SignatureTombedTLSSignature ( uint8_t * pucSig , size_t * pxSigLen , size_t xSigMaxLen ) { int8_t xReturn = 0 ; if ( ( pucSig == NULL ) || ( pxSigLen == NULL ) ) { xReturn = FAILURE ; } if ( xReturn == 0 ) { int rc_mbedtls = 0 ; rc_mbedtls = pk_ecdsa_sig_asn1_from_psa ( ( unsigned char * ) pucSig , pxSigLen , xSigMaxLen ) ; if ( 0 != rc_mbedtls ) { printf ( " \r \n " , rc_mbedtls ) ; xReturn = FAILURE ; } } return xReturn ; }
Convert an EC signature from PKCS #11 format to DER encoded.
Convert an EC signature from PKCS #11 format to DER encoded .