Decrypt encrypted data in a single part.
#include <smartcard/sc_smart_card.h>
sc_response_code_t sc_decrypt(sc_context_t *context,
const unsigned char *ciphertext,
size_t ciphertext_length,
unsigned char *plaintext,
size_t *plaintext_length)
BlackBerry 10.2.0
Active smart card context. This value cannot be NULL.
The input buffer that contains the ciphertext to be decrypted. This value cannot be NULL.
The length of the ciphertext buffer.
The output buffer where the plaintext data will be written. If NULL, only plaintext length will be returned.
On input, the length of the plaintext buffer. On output, the plaintext length. This value cannot be NULL.
This function decrypts encrypted data into plaintext using RSA. If the result is padded plaintext, this function returns the padded plaintext.
Some card drivers require that you call decryption initialization (sc_decrypt_init()) before performing each decryption 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.