mbedtls_pk_sign() function
Make signature, including padding if relevant.
Arguments
ctx
The PK context to use. It must have been set up with a private key.
md_alg
Hash algorithm used (see notes)
hash
Hash of the message to sign
hash_len
Hash length or 0 (see notes)
sig
Place to write the signature
sig_len
Number of bytes written
Return value
0 on success, or a specific error code.
Notes
For RSA keys, the default padding type is PKCS#1 v1.5. There is no interface in the PK module to make RSASSA-PSS signatures yet. If hash_len is 0, then the length associated with md_alg is used instead, or an error returned if it is invalid. For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0. For ECDSA, md_alg may never be MBEDTLS_MD_NONE.