SmartCardCryptoProvider::encrypt()

Encrypt data in a single part.

Synopsis:

#include <smartcard_spi/SmartCardCryptoProvider.hpp>
virtual sc_response_code_t smartcard_spi::SmartCardCryptoProvider::encrypt(const unsigned char *plaintext, unsigned int plaintextLength, unsigned char *ciphertext, unsigned int &ciphertextLength)

Since:

BlackBerry 10.3.0

Arguments:

plaintext

The input buffer containing the plaintext to be encrypted. Must not be NULL.

plaintextLength

The plaintext buffer length.

ciphertext

The output buffer where the ciphertext data will be written. If NULL, only the ciphertext length will be returned.

ciphertextLength

On input, this parameter specifies the ciphertext buffer length. On output, this parameter specifies the ciphertext length.

Library:

libscs (For the qcc command, use the -l scs option to link against this library)

Description:

This function encrypts data in a single part.

Algorithm specific notes:
  • RSA: No padding bytes are added or removed.

Depending on card driver implementation, this function may or may not be called multiple times without re-initializing.

Returns:

If the function succeeds, SC_SCARD_S_SUCCESS is returned. Otherwise, an error code is returned.

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus