sc_import_key()

Import a new key to the smart card.

Synopsis:

#include <smartcard/sc_smart_card.h>
 
sc_response_code_t sc_import_key(sc_context_t *context,                 
                                 const unsigned char *certificate,                 
                                 size_t certificate_length,                 
                                 const unsigned char *private_key,                 
                                 size_t private_key_length,                 
                                 sc_key_store_data_t *key_store_data)

Since:

BlackBerry 10.3.1

Arguments:

context

The active smart card context. Must not be NULL.

certificate

The certificate to import. The certificate should be DER-encoded in X.509 format. Must not be NULL.

certificate_length

The certificate length.

private_key

The private key to import. The private key should be DER-encoded in PKCS8 format and provided in plain text (PKCS8 should not be encrypted). Must not be NULL.

private_key_length

The length of the private key.

key_store_data

The instance of the key store data that identifies the key on the card. On input, if an existing key store data element is provided, the existing key referenced by this key store data instance is replaced with a new key created from the provided data. If a newly created key store data instance is provided, a new key is created. On output, the instance of the key store data identifying the newly created key. Must not be NULL.

Library:

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

Description:

Returns:

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

Last modified: 2014-09-30



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

comments powered by Disqus