sc_generate_random_data()

Return a buffer with random bytes generated by the card.

Synopsis:

#include <smartcard/sc_smart_card.h>
 
sc_response_code_t sc_generate_random_data(sc_context_t *context,                 
                                           unsigned char *randomData,                 
                                           size_t *randomDataLength)

Since:

BlackBerry 10.3.0

Arguments:

context

The active smart card context. Must not be NULL.

randomData

A buffer for storing generated random data. If NULL is specified, randomDataLength may return the maximum number of bytes it can generate. If this feature is not supported, the function returns an error.

randomDataLength

On input, specifies the requested number of random bytes to generate. On output, returns the actual number of random bytes generated.

Library:

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

Description:

The data produced by this method should be cryptographically random.

You must call sc_allocate_handle() to allocate a handle of type SC_HANDLE_CARD_CRYPTO_PROVIDER_X before calling this function; otherwise an error is returned.

Returns:

SC_SCARD_S_SUCCESS upon success, an error code otherwise. See sc_response_code_t for defined error codes.