Perform a signing operation.
#include <smartcard/sc_smart_card.h>
sc_response_code_t sc_sign(sc_context_t *context,
const unsigned char *plaintext,
size_t plaintext_length,
unsigned char *signature,
size_t *signature_length)
BlackBerry 10.2.0
The active smart card context. This value cannot be NULL.
The input buffer that contains the plaintext to be encrypted. This value cannot be NULL.
Length of the plaintext buffer.
The output buffer where the signature data will be written. if the value is NULL, only the signature length is returned.
On input, the length of the signature buffer. On output, the signature length. This value cannot be NULL.
This function encrypts plaintext provided by the caller using RSA. Note that the caller is expected to provide padded plaintext, if required. PKCS 1.5 padding may be used for RSA. This function does not add or remove padding bytes.
Some card drivers require that you call initialization (sc_sign_init()) before performing each signing operation. Others do not. Depending on the card driver implementation, you may be able to call this function multiple times without re-initializing.
A handle of type SC_HANDLE_CARD_CRYPTO_PROVIDER_X must be allocated before calling this function, otherwise an error is returned.
SC_SCARD_S_SUCCESS upon success, an error code otherwise. See sc_response_code_t for defined error codes.