2002-04-02 13:26:42 +00:00
|
|
|
/*
|
|
|
|
* Function prototypes for pkcs15-init
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Olaf Kirch <okir@lst.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PKCS15_INIT_H
|
|
|
|
#define PKCS15_INIT_H
|
|
|
|
|
2005-02-02 10:21:10 +00:00
|
|
|
#ifdef __cplusplus
|
2002-04-19 14:23:31 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-04-05 13:48:00 +00:00
|
|
|
#include <opensc/pkcs15.h>
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2005-09-07 09:32:52 +00:00
|
|
|
#define SC_PKCS15INIT_X509_DIGITAL_SIGNATURE 0x0080UL
|
|
|
|
#define SC_PKCS15INIT_X509_NON_REPUDIATION 0x0040UL
|
|
|
|
#define SC_PKCS15INIT_X509_KEY_ENCIPHERMENT 0x0020UL
|
|
|
|
#define SC_PKCS15INIT_X509_DATA_ENCIPHERMENT 0x0010UL
|
|
|
|
#define SC_PKCS15INIT_X509_KEY_AGREEMENT 0x0008UL
|
|
|
|
#define SC_PKCS15INIT_X509_KEY_CERT_SIGN 0x0004UL
|
|
|
|
#define SC_PKCS15INIT_X509_CRL_SIGN 0x0002UL
|
|
|
|
|
2003-10-13 16:13:12 +00:00
|
|
|
typedef struct sc_profile sc_profile_t; /* opaque type */
|
2002-04-02 13:26:42 +00:00
|
|
|
|
|
|
|
struct sc_pkcs15init_operations {
|
|
|
|
/*
|
|
|
|
* Erase everything that's on the card
|
2006-12-18 11:22:51 +00:00
|
|
|
*/
|
2002-04-02 13:26:42 +00:00
|
|
|
int (*erase_card)(struct sc_profile *, struct sc_card *);
|
|
|
|
|
2003-10-13 16:13:12 +00:00
|
|
|
/*
|
|
|
|
* New style API
|
|
|
|
*/
|
|
|
|
|
2003-12-19 09:29:56 +00:00
|
|
|
/*
|
|
|
|
* Card-specific initialization of PKCS15 meta-information.
|
|
|
|
* Currently used by the cflex driver to read the card's
|
|
|
|
* serial number and use it as the pkcs15 serial number.
|
|
|
|
*/
|
|
|
|
int (*init_card)(sc_profile_t *, sc_card_t *);
|
|
|
|
|
2003-10-13 16:13:12 +00:00
|
|
|
/*
|
|
|
|
* Create a DF
|
|
|
|
*/
|
|
|
|
int (*create_dir)(sc_profile_t *, sc_card_t *, sc_file_t *);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a "pin domain". This is for cards such as
|
|
|
|
* the cryptoflex that need to put their pins into
|
|
|
|
* separate directories
|
|
|
|
*/
|
|
|
|
int (*create_domain)(sc_profile_t *, sc_card_t *,
|
|
|
|
const sc_pkcs15_id_t *, sc_file_t **);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a PIN reference
|
|
|
|
*/
|
|
|
|
int (*select_pin_reference)(sc_profile_t *, sc_card_t *,
|
|
|
|
sc_pkcs15_pin_info_t *);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a PIN object within the given DF.
|
|
|
|
*
|
|
|
|
* The pin_info object is completely filled in by the caller.
|
|
|
|
* The card driver can reject the pin reference; in this case
|
|
|
|
* the caller needs to adjust it.
|
|
|
|
*/
|
|
|
|
int (*create_pin)(sc_profile_t *, sc_card_t *, sc_file_t *,
|
2003-10-17 11:21:48 +00:00
|
|
|
sc_pkcs15_object_t *,
|
2003-12-18 21:37:34 +00:00
|
|
|
const u8 *pin, size_t pin_len,
|
|
|
|
const u8 *puk, size_t puk_len);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a reference for a private key object
|
|
|
|
*/
|
|
|
|
int (*select_key_reference)(sc_profile_t *, sc_card_t *,
|
|
|
|
sc_pkcs15_prkey_info_t *);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create an empty key object.
|
|
|
|
* @index is the number key objects already on the card.
|
|
|
|
* @pin_info contains information on the PIN protecting
|
|
|
|
* the key. NULL if the key should be
|
|
|
|
* unprotected.
|
|
|
|
* @key_info should be filled in by the function
|
|
|
|
*/
|
|
|
|
int (*create_key)(sc_profile_t *, sc_card_t *,
|
|
|
|
sc_pkcs15_object_t *o);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Store a key on the card
|
|
|
|
*/
|
|
|
|
int (*store_key)(sc_profile_t *, sc_card_t *,
|
|
|
|
sc_pkcs15_object_t *,
|
|
|
|
sc_pkcs15_prkey_t *);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generate key
|
|
|
|
*/
|
|
|
|
int (*generate_key)(sc_profile_t *, sc_card_t *,
|
|
|
|
sc_pkcs15_object_t *,
|
|
|
|
sc_pkcs15_pubkey_t *);
|
|
|
|
|
2003-12-08 11:43:21 +00:00
|
|
|
/*
|
|
|
|
* Encode private/public key
|
|
|
|
* These are used mostly by the Cryptoflex/Cyberflex drivers.
|
|
|
|
*/
|
|
|
|
int (*encode_private_key)(sc_profile_t *, sc_card_t *,
|
|
|
|
struct sc_pkcs15_prkey_rsa *,
|
|
|
|
u8 *buf, size_t *bufsize, int key_ref);
|
|
|
|
int (*encode_public_key)(sc_profile_t *, sc_card_t *,
|
|
|
|
struct sc_pkcs15_prkey_rsa *,
|
|
|
|
u8 *buf, size_t *bufsize, int key_ref);
|
|
|
|
|
2004-04-17 09:23:26 +00:00
|
|
|
/*
|
|
|
|
* Finalize card
|
2005-06-16 19:35:31 +00:00
|
|
|
* Ends the initialization phase of the smart card/token
|
2004-04-17 09:23:26 +00:00
|
|
|
* (actually this command is currently only for starcos spk 2.3
|
|
|
|
* cards).
|
|
|
|
*/
|
|
|
|
int (*finalize_card)(sc_card_t *);
|
|
|
|
|
2003-12-08 11:43:21 +00:00
|
|
|
/*
|
|
|
|
* Old-style API
|
|
|
|
*/
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
/*
|
2002-04-02 14:45:55 +00:00
|
|
|
* Initialize application, and optionally set a SO pin
|
2002-04-02 13:26:42 +00:00
|
|
|
*/
|
2002-04-02 14:45:55 +00:00
|
|
|
int (*init_app)(struct sc_profile *, struct sc_card *,
|
2003-10-13 16:13:12 +00:00
|
|
|
struct sc_pkcs15_pin_info *,
|
2003-12-18 21:37:34 +00:00
|
|
|
const u8 *pin, size_t pin_len,
|
|
|
|
const u8 *puk, size_t puk_len);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Store a new PIN
|
|
|
|
* On some cards (such as the CryptoFlex) this will create
|
|
|
|
* a new subdirectory of the AppDF.
|
|
|
|
* Index is the number of the PIN in the AODF (this should
|
|
|
|
* help the card driver to pick the right file ID/directory ID/
|
|
|
|
* pin file index.
|
|
|
|
*/
|
|
|
|
int (*new_pin)(struct sc_profile *, struct sc_card *,
|
2004-12-22 09:48:27 +00:00
|
|
|
struct sc_pkcs15_pin_info *, unsigned int idx,
|
2003-12-18 21:37:34 +00:00
|
|
|
const u8 *pin, size_t pin_len,
|
|
|
|
const u8 *puk, size_t puk_len);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Store a key on the card
|
|
|
|
*/
|
|
|
|
int (*new_key)(struct sc_profile *, struct sc_card *,
|
2004-12-22 09:48:27 +00:00
|
|
|
struct sc_pkcs15_prkey *key, unsigned int idx,
|
2002-04-02 13:26:42 +00:00
|
|
|
struct sc_pkcs15_prkey_info *);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a file based on a PKCS15_TYPE_xxx
|
|
|
|
*/
|
|
|
|
int (*new_file)(struct sc_profile *, struct sc_card *,
|
|
|
|
unsigned int, unsigned int, struct sc_file **out);
|
2002-06-06 09:18:53 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Generate a new key pair
|
|
|
|
*/
|
2003-10-13 16:13:12 +00:00
|
|
|
int (*old_generate_key)(struct sc_profile *, struct sc_card *,
|
2004-12-22 09:48:27 +00:00
|
|
|
unsigned int idx, unsigned int keybits,
|
2002-06-17 10:58:04 +00:00
|
|
|
sc_pkcs15_pubkey_t *pubkey_res,
|
|
|
|
struct sc_pkcs15_prkey_info *);
|
2002-06-06 09:18:53 +00:00
|
|
|
|
2005-08-22 09:20:13 +00:00
|
|
|
/*
|
|
|
|
* Delete object
|
|
|
|
*/
|
|
|
|
int (*delete_object)(struct sc_profile *, struct sc_card *,
|
|
|
|
unsigned int type, const void *data, const sc_path_t *path);
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2002-06-04 08:51:03 +00:00
|
|
|
/* Do not change these or reorder these */
|
2002-04-02 13:26:42 +00:00
|
|
|
#define SC_PKCS15INIT_SO_PIN 0
|
|
|
|
#define SC_PKCS15INIT_SO_PUK 1
|
|
|
|
#define SC_PKCS15INIT_USER_PIN 2
|
|
|
|
#define SC_PKCS15INIT_USER_PUK 3
|
|
|
|
#define SC_PKCS15INIT_NPINS 4
|
|
|
|
|
|
|
|
struct sc_pkcs15init_callbacks {
|
|
|
|
/*
|
|
|
|
* Get a PIN from the front-end. The first argument is
|
2002-12-04 11:56:34 +00:00
|
|
|
* one of the SC_PKCS15INIT_XXX_PIN/PUK macros.
|
2002-04-02 13:26:42 +00:00
|
|
|
*/
|
|
|
|
int (*get_pin)(struct sc_profile *, int,
|
|
|
|
const struct sc_pkcs15_pin_info *,
|
2003-05-15 11:30:46 +00:00
|
|
|
const char *label,
|
2002-04-02 13:26:42 +00:00
|
|
|
u8 *, size_t *);
|
2002-12-04 11:56:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a transport/secure messaging key from the front-end.
|
|
|
|
*/
|
2002-04-02 13:26:42 +00:00
|
|
|
int (*get_key)(struct sc_profile *,
|
2002-12-04 11:56:34 +00:00
|
|
|
int method, int reference,
|
|
|
|
const u8 *def_key, size_t def_size,
|
|
|
|
u8 *key_buf, size_t *key_size);
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2002-04-02 14:45:55 +00:00
|
|
|
struct sc_pkcs15init_initargs {
|
|
|
|
const u8 * so_pin;
|
|
|
|
size_t so_pin_len;
|
|
|
|
const u8 * so_puk;
|
|
|
|
size_t so_puk_len;
|
2003-10-13 16:13:12 +00:00
|
|
|
const char * so_pin_label;
|
2002-04-05 14:56:21 +00:00
|
|
|
const char * label;
|
2002-04-07 13:15:31 +00:00
|
|
|
const char * serial;
|
2002-04-02 14:45:55 +00:00
|
|
|
};
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
struct sc_pkcs15init_pinargs {
|
|
|
|
struct sc_pkcs15_id auth_id;
|
|
|
|
const char * label;
|
|
|
|
const u8 * pin;
|
|
|
|
size_t pin_len;
|
|
|
|
const u8 * puk;
|
|
|
|
size_t puk_len;
|
|
|
|
};
|
|
|
|
|
2002-04-15 13:42:10 +00:00
|
|
|
struct sc_pkcs15init_prkeyargs {
|
2002-04-02 13:26:42 +00:00
|
|
|
struct sc_pkcs15_id id;
|
|
|
|
struct sc_pkcs15_id auth_id;
|
|
|
|
const char * label;
|
|
|
|
unsigned long usage;
|
2002-04-15 13:42:10 +00:00
|
|
|
unsigned long x509_usage;
|
2003-04-17 12:38:08 +00:00
|
|
|
unsigned int flags;
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2002-04-15 13:42:10 +00:00
|
|
|
sc_pkcs15_prkey_t key;
|
2002-04-17 20:47:18 +00:00
|
|
|
|
|
|
|
/* support for non-native keys */
|
|
|
|
char * passphrase;
|
2002-04-15 13:42:10 +00:00
|
|
|
};
|
2003-12-08 12:02:28 +00:00
|
|
|
|
|
|
|
struct sc_pkcs15init_keygen_args {
|
|
|
|
struct sc_pkcs15init_prkeyargs prkey_args;
|
|
|
|
const char * pubkey_label;
|
|
|
|
};
|
|
|
|
|
2002-04-17 20:47:18 +00:00
|
|
|
#define SC_PKCS15INIT_EXTRACTABLE 0x0001
|
|
|
|
#define SC_PKCS15INIT_NO_PASSPHRASE 0x0002
|
2003-04-17 12:38:08 +00:00
|
|
|
#define SC_PKCS15INIT_SPLIT_KEY 0x0004
|
2002-04-15 13:42:10 +00:00
|
|
|
|
|
|
|
struct sc_pkcs15init_pubkeyargs {
|
|
|
|
struct sc_pkcs15_id id;
|
|
|
|
struct sc_pkcs15_id auth_id;
|
|
|
|
const char * label;
|
|
|
|
unsigned long usage;
|
|
|
|
unsigned long x509_usage;
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2002-04-15 13:42:10 +00:00
|
|
|
sc_pkcs15_pubkey_t key;
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2002-12-18 10:17:01 +00:00
|
|
|
struct sc_pkcs15init_dataargs {
|
|
|
|
struct sc_pkcs15_id id;
|
|
|
|
const char * label;
|
2003-06-14 12:31:30 +00:00
|
|
|
struct sc_pkcs15_id auth_id;
|
2003-08-20 14:15:02 +00:00
|
|
|
const char * app_label;
|
|
|
|
struct sc_object_id app_oid;
|
2002-12-18 10:17:01 +00:00
|
|
|
|
2003-08-20 14:15:02 +00:00
|
|
|
sc_pkcs15_der_t der_encoded; /* Wrong name: is not DER encoded */
|
2002-12-18 10:17:01 +00:00
|
|
|
};
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
struct sc_pkcs15init_certargs {
|
|
|
|
struct sc_pkcs15_id id;
|
|
|
|
const char * label;
|
|
|
|
|
2002-04-15 13:42:10 +00:00
|
|
|
unsigned long x509_usage;
|
2002-04-22 18:37:57 +00:00
|
|
|
unsigned char authority;
|
2002-04-15 13:42:10 +00:00
|
|
|
sc_pkcs15_der_t der_encoded;
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2003-06-27 11:59:37 +00:00
|
|
|
#define P15_ATTR_TYPE_LABEL 0
|
|
|
|
#define P15_ATTR_TYPE_ID 1
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
extern void sc_pkcs15init_set_callbacks(struct sc_pkcs15init_callbacks *);
|
2003-06-18 08:07:12 +00:00
|
|
|
extern int sc_pkcs15init_bind(struct sc_card *, const char *, const char *,
|
2002-04-05 10:05:50 +00:00
|
|
|
struct sc_profile **);
|
2002-04-08 15:46:44 +00:00
|
|
|
extern void sc_pkcs15init_unbind(struct sc_profile *);
|
2003-10-21 11:05:35 +00:00
|
|
|
extern void sc_pkcs15init_set_p15card(sc_profile_t *,
|
|
|
|
sc_pkcs15_card_t *);
|
2003-04-22 17:00:38 +00:00
|
|
|
extern int sc_pkcs15init_set_lifecycle(sc_card_t *card, int lcycle);
|
2002-04-05 10:05:50 +00:00
|
|
|
extern int sc_pkcs15init_erase_card(struct sc_card *,
|
|
|
|
struct sc_profile *);
|
2004-04-17 09:23:26 +00:00
|
|
|
/* XXX could this function be merged with ..._set_lifecycle ?? */
|
|
|
|
extern int sc_pkcs15init_finalize_card(sc_card_t *,
|
|
|
|
struct sc_profile *);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_add_app(struct sc_card *,
|
2002-04-02 14:45:55 +00:00
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15init_initargs *);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_store_pin(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15init_pinargs *);
|
|
|
|
extern int sc_pkcs15init_generate_key(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
2003-12-08 12:02:28 +00:00
|
|
|
struct sc_pkcs15init_keygen_args *,
|
2002-04-15 13:42:10 +00:00
|
|
|
unsigned int keybits,
|
2002-04-11 15:14:12 +00:00
|
|
|
struct sc_pkcs15_object **);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_store_private_key(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
2002-04-15 13:42:10 +00:00
|
|
|
struct sc_pkcs15init_prkeyargs *,
|
2002-04-11 15:14:12 +00:00
|
|
|
struct sc_pkcs15_object **);
|
2003-05-15 11:30:46 +00:00
|
|
|
extern int sc_pkcs15init_store_split_key(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15init_prkeyargs *,
|
|
|
|
struct sc_pkcs15_object **,
|
|
|
|
struct sc_pkcs15_object **);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_store_public_key(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
2002-04-15 13:42:10 +00:00
|
|
|
struct sc_pkcs15init_pubkeyargs *,
|
2002-04-11 15:14:12 +00:00
|
|
|
struct sc_pkcs15_object **);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_store_certificate(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
2002-04-11 15:14:12 +00:00
|
|
|
struct sc_pkcs15init_certargs *,
|
|
|
|
struct sc_pkcs15_object **);
|
2002-12-18 10:17:01 +00:00
|
|
|
extern int sc_pkcs15init_store_data_object(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15init_dataargs *,
|
|
|
|
struct sc_pkcs15_object **);
|
2003-06-27 11:59:37 +00:00
|
|
|
/* Change the value of a pkcs15 attribute.
|
|
|
|
* new_attrib_type can (currently) be either P15_ATTR_TYPE_LABEL or
|
|
|
|
* P15_ATTR_TYPE_ID.
|
|
|
|
* If P15_ATTR_TYPE_LABEL, then *new_value is a struct sc_pkcs15_id;
|
|
|
|
* If P15_ATTR_TYPE_ID, then *new_value is a char array.
|
|
|
|
*/
|
|
|
|
extern int sc_pkcs15init_change_attrib(struct sc_pkcs15_card *p15card,
|
|
|
|
struct sc_profile *profile,
|
|
|
|
struct sc_pkcs15_object *object,
|
|
|
|
int new_attrib_type,
|
|
|
|
void *new_value,
|
|
|
|
int new_len);
|
2005-08-22 09:20:13 +00:00
|
|
|
extern int sc_pkcs15init_delete_object(sc_pkcs15_card_t *p15card,
|
|
|
|
sc_profile_t *profile,
|
|
|
|
sc_pkcs15_object_t *obj);
|
2005-09-15 19:40:20 +00:00
|
|
|
/* Replace an existing cert with a new one, which is assumed to be
|
|
|
|
* compatible with the correcsponding private key (e.g. the old and
|
|
|
|
* new cert should have the same public key).
|
|
|
|
*/
|
|
|
|
extern int sc_pkcs15init_update_certificate(sc_pkcs15_card_t *p15card,
|
|
|
|
sc_profile_t *profile,
|
|
|
|
sc_pkcs15_object_t *obj,
|
|
|
|
const unsigned char *rawcert,
|
2006-01-11 23:41:17 +00:00
|
|
|
size_t certlen);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
|
|
|
extern int sc_pkcs15init_create_file(struct sc_profile *,
|
|
|
|
struct sc_card *, struct sc_file *);
|
|
|
|
extern int sc_pkcs15init_update_file(struct sc_profile *,
|
|
|
|
struct sc_card *, struct sc_file *, void *, unsigned int);
|
|
|
|
extern int sc_pkcs15init_authenticate(struct sc_profile *,
|
|
|
|
struct sc_card *, struct sc_file *, int);
|
|
|
|
extern int sc_pkcs15init_fixup_file(struct sc_profile *, struct sc_file *);
|
|
|
|
extern int sc_pkcs15init_fixup_acls(struct sc_profile *,
|
|
|
|
struct sc_file *,
|
|
|
|
struct sc_acl_entry *,
|
|
|
|
struct sc_acl_entry *);
|
2002-04-05 10:05:50 +00:00
|
|
|
extern int sc_pkcs15init_get_pin_info(struct sc_profile *, unsigned int,
|
|
|
|
struct sc_pkcs15_pin_info *);
|
2003-10-13 16:13:12 +00:00
|
|
|
extern int sc_profile_get_pin_retries(sc_profile_t *, unsigned int);
|
2002-04-05 14:56:21 +00:00
|
|
|
extern int sc_pkcs15init_get_manufacturer(struct sc_profile *,
|
|
|
|
const char **);
|
|
|
|
extern int sc_pkcs15init_get_serial(struct sc_profile *, const char **);
|
2002-04-07 13:15:31 +00:00
|
|
|
extern int sc_pkcs15init_set_serial(struct sc_profile *, const char *);
|
2002-04-05 14:56:21 +00:00
|
|
|
extern int sc_pkcs15init_get_label(struct sc_profile *, const char **);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2003-05-17 09:10:32 +00:00
|
|
|
extern void sc_pkcs15init_set_secret(struct sc_profile *,
|
|
|
|
int, int, u8 *, size_t);
|
2004-12-22 09:48:27 +00:00
|
|
|
extern int sc_pkcs15init_set_pin_data(struct sc_profile *, int,
|
|
|
|
const u8 *, size_t);
|
2003-10-13 16:13:12 +00:00
|
|
|
extern int sc_pkcs15init_verify_key(struct sc_profile *, struct sc_card *,
|
|
|
|
sc_file_t *, unsigned int, unsigned int);
|
2005-08-22 09:20:13 +00:00
|
|
|
extern int sc_pkcs15init_delete_by_path(struct sc_profile *,
|
|
|
|
struct sc_card *, const sc_path_t *path);
|
2006-01-03 16:24:54 +00:00
|
|
|
extern int sc_pkcs15init_update_any_df(sc_pkcs15_card_t *, sc_profile_t *,
|
|
|
|
sc_pkcs15_df_t *, int);
|
2002-04-11 15:14:12 +00:00
|
|
|
|
2002-06-18 18:18:21 +00:00
|
|
|
/* Erasing the card structure via rm -rf */
|
|
|
|
extern int sc_pkcs15init_erase_card_recursively(struct sc_card *,
|
|
|
|
struct sc_profile *, int so_ref);
|
|
|
|
extern int sc_pkcs15init_rmdir(struct sc_card *, struct sc_profile *,
|
|
|
|
struct sc_file *df);
|
|
|
|
|
2003-04-17 12:38:08 +00:00
|
|
|
/* Helper function for CardOS */
|
|
|
|
extern int sc_pkcs15init_requires_restrictive_usage(
|
|
|
|
struct sc_pkcs15_card *,
|
2003-05-15 11:30:46 +00:00
|
|
|
struct sc_pkcs15init_prkeyargs *,
|
|
|
|
unsigned int);
|
2003-04-17 12:38:08 +00:00
|
|
|
|
2003-10-13 16:13:12 +00:00
|
|
|
extern int sc_pkcs15_create_pin_domain(sc_profile_t *, sc_card_t *,
|
|
|
|
const sc_pkcs15_id_t *, sc_file_t **);
|
|
|
|
|
2003-10-13 20:41:00 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_gpk_ops(void);
|
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_miocos_ops(void);
|
2003-12-08 11:43:21 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_cryptoflex_ops(void);
|
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_cyberflex_ops(void);
|
2006-01-23 22:02:07 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_cardos_ops(void);
|
2003-12-29 12:28:37 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_jcop_ops(void);
|
2004-04-17 09:23:26 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_starcos_ops(void);
|
2004-06-16 20:59:59 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_oberthur_ops(void);
|
2005-04-04 09:30:54 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_setcos_ops(void);
|
2005-10-24 21:58:35 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_incrypto34_ops(void);
|
2006-06-07 08:33:37 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_muscle_ops(void);
|
2007-07-03 20:44:34 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_asepcos_ops(void);
|
2003-10-13 20:41:00 +00:00
|
|
|
|
2005-02-02 10:21:10 +00:00
|
|
|
#ifdef __cplusplus
|
2002-04-19 14:23:31 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
#endif /* PKCS15_INIT_H */
|