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
|
|
|
|
|
2010-03-04 08:14:36 +00:00
|
|
|
#include "libopensc/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
|
|
|
|
|
2010-03-18 09:46:35 +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
|
|
|
*/
|
2010-02-21 16:21:57 +00:00
|
|
|
int (*erase_card)(struct sc_profile *, struct sc_pkcs15_card *);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
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.
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*init_card)(struct sc_profile *, struct sc_pkcs15_card *);
|
2003-12-19 09:29:56 +00:00
|
|
|
|
2003-10-13 16:13:12 +00:00
|
|
|
/*
|
|
|
|
* Create a DF
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*create_dir)(struct sc_profile *, struct sc_pkcs15_card *, struct sc_file *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a "pin domain". This is for cards such as
|
|
|
|
* the cryptoflex that need to put their pins into
|
|
|
|
* separate directories
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*create_domain)(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
const struct sc_pkcs15_id *, struct sc_file **);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a PIN reference
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*select_pin_reference)(struct sc_profile *, struct sc_pkcs15_card *,
|
2011-06-05 15:46:25 +00:00
|
|
|
struct sc_pkcs15_auth_info *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*create_pin)(struct sc_profile *, struct sc_pkcs15_card *, struct sc_file *,
|
|
|
|
struct sc_pkcs15_object *,
|
|
|
|
const unsigned char *, size_t,
|
|
|
|
const unsigned char *, size_t);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a reference for a private key object
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*select_key_reference)(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
struct sc_pkcs15_prkey_info *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*create_key)(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
struct sc_pkcs15_object *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Store a key on the card
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*store_key)(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
struct sc_pkcs15_object *,
|
|
|
|
struct sc_pkcs15_prkey *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Generate key
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*generate_key)(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
struct sc_pkcs15_object *,
|
|
|
|
struct sc_pkcs15_pubkey *);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
2003-12-08 11:43:21 +00:00
|
|
|
/*
|
|
|
|
* Encode private/public key
|
|
|
|
* These are used mostly by the Cryptoflex/Cyberflex drivers.
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*encode_private_key)(struct sc_profile *, struct sc_card *,
|
2003-12-08 11:43:21 +00:00
|
|
|
struct sc_pkcs15_prkey_rsa *,
|
2010-03-18 09:49:49 +00:00
|
|
|
unsigned char *, size_t *, int);
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*encode_public_key)(struct sc_profile *, struct sc_card *,
|
2003-12-08 11:43:21 +00:00
|
|
|
struct sc_pkcs15_prkey_rsa *,
|
2010-03-18 09:49:49 +00:00
|
|
|
unsigned char *, size_t *, int);
|
2003-12-08 11:43:21 +00:00
|
|
|
|
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).
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
int (*finalize_card)(struct sc_card *);
|
2004-04-17 09:23:26 +00:00
|
|
|
|
2005-08-22 09:20:13 +00:00
|
|
|
/*
|
|
|
|
* Delete object
|
|
|
|
*/
|
2010-02-21 16:21:57 +00:00
|
|
|
int (*delete_object)(struct sc_profile *, struct sc_pkcs15_card *,
|
2011-04-15 16:50:04 +00:00
|
|
|
struct sc_pkcs15_object *, const struct sc_path *);
|
2010-03-18 09:10:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Support of pkcs15init emulation
|
|
|
|
*/
|
2010-07-02 13:46:13 +00:00
|
|
|
int (*emu_update_dir) (struct sc_profile *, struct sc_pkcs15_card *,
|
2010-03-18 09:10:51 +00:00
|
|
|
struct sc_app_info *);
|
2010-07-02 13:46:13 +00:00
|
|
|
int (*emu_update_any_df) (struct sc_profile *, struct sc_pkcs15_card *,
|
2010-03-18 09:10:51 +00:00
|
|
|
unsigned, struct sc_pkcs15_object *);
|
2010-07-02 13:46:13 +00:00
|
|
|
int (*emu_update_tokeninfo) (struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
struct sc_pkcs15_tokeninfo *);
|
|
|
|
int (*emu_write_info)(struct sc_profile *, struct sc_pkcs15_card *,
|
2010-03-18 09:10:51 +00:00
|
|
|
struct sc_pkcs15_object *);
|
2010-12-30 12:50:35 +00:00
|
|
|
int (*emu_store_data)(struct sc_pkcs15_card *, struct sc_profile *, struct sc_pkcs15_object *,
|
|
|
|
struct sc_pkcs15_der *, struct sc_path *);
|
2010-07-02 14:26:29 +00:00
|
|
|
|
|
|
|
int (*sanity_check)(struct sc_profile *, struct sc_pkcs15_card *);
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2002-06-04 08:51:03 +00:00
|
|
|
/* Do not change these or reorder these */
|
2009-11-10 18:51:24 +00:00
|
|
|
#define SC_PKCS15INIT_ID_STYLE_NATIVE 0
|
|
|
|
#define SC_PKCS15INIT_ID_STYLE_MOZILLA 1
|
|
|
|
#define SC_PKCS15INIT_ID_STYLE_RFC2459 2
|
|
|
|
|
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
|
|
|
|
|
2012-05-26 07:17:21 +00:00
|
|
|
#define SC_PKCS15INIT_MD_STYLE_NONE 0
|
|
|
|
#define SC_PKCS15INIT_MD_STYLE_GEMALTO 1
|
|
|
|
|
2002-04-02 13:26:42 +00:00
|
|
|
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
|
|
|
*/
|
2011-06-05 15:46:25 +00:00
|
|
|
int (*get_pin)(struct sc_profile *, int, const struct sc_pkcs15_auth_info *,
|
2010-03-18 09:39:16 +00:00
|
|
|
const char *, unsigned char *, size_t *);
|
2002-12-04 11:56:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a transport/secure messaging key from the front-end.
|
|
|
|
*/
|
2010-03-18 09:49:49 +00:00
|
|
|
int (*get_key)(struct sc_profile *, int, int,
|
|
|
|
const unsigned char *, size_t,
|
|
|
|
unsigned char *, size_t *);
|
2002-04-02 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
2002-04-02 14:45:55 +00:00
|
|
|
struct sc_pkcs15init_initargs {
|
2010-03-18 09:39:16 +00:00
|
|
|
const unsigned char * so_pin;
|
2002-04-02 14:45:55 +00:00
|
|
|
size_t so_pin_len;
|
2010-03-18 09:39:16 +00:00
|
|
|
const unsigned char * so_puk;
|
2002-04-02 14:45:55 +00:00
|
|
|
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;
|
2010-03-18 09:39:16 +00:00
|
|
|
const unsigned char * pin;
|
2002-04-02 13:26:42 +00:00
|
|
|
size_t pin_len;
|
2010-01-27 17:38:43 +00:00
|
|
|
|
|
|
|
struct sc_pkcs15_id puk_id;
|
|
|
|
const char * puk_label;
|
2010-03-18 09:39:16 +00:00
|
|
|
const unsigned char * puk;
|
2002-04-02 13:26:42 +00:00
|
|
|
size_t puk_len;
|
|
|
|
};
|
|
|
|
|
2009-10-05 18:40:51 +00:00
|
|
|
struct sc_pkcs15init_keyarg_gost_params {
|
|
|
|
unsigned char gostr3410, gostr3411, gost28147;
|
|
|
|
};
|
|
|
|
|
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;
|
2012-05-25 07:56:15 +00:00
|
|
|
const char * guid;
|
2002-04-02 13:26:42 +00:00
|
|
|
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;
|
2010-04-01 14:16:43 +00:00
|
|
|
unsigned int access_flags;
|
2011-04-12 11:36:40 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
struct sc_pkcs15init_keyarg_gost_params gost;
|
2011-04-22 13:08:45 +00:00
|
|
|
struct sc_pkcs15_ec_parameters ec;
|
2011-04-12 11:36:40 +00:00
|
|
|
} params;
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2010-03-18 09:39:16 +00:00
|
|
|
struct sc_pkcs15_prkey key;
|
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-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;
|
2011-04-12 11:36:40 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
struct sc_pkcs15init_keyarg_gost_params gost;
|
2011-04-22 13:08:45 +00:00
|
|
|
struct sc_pkcs15_ec_parameters ec;
|
2011-04-12 11:36:40 +00:00
|
|
|
} params;
|
2002-04-02 13:26:42 +00:00
|
|
|
|
2010-03-18 09:39:16 +00:00
|
|
|
struct sc_pkcs15_pubkey 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
|
|
|
|
2010-03-18 09:39:16 +00:00
|
|
|
struct sc_pkcs15_der der_encoded; /* Wrong name: is not DER encoded */
|
2002-12-18 10:17:01 +00:00
|
|
|
};
|
|
|
|
|
2012-05-26 19:17:39 +00:00
|
|
|
struct sc_pkcs15init_skeyargs {
|
|
|
|
struct sc_pkcs15_id id;
|
|
|
|
struct sc_pkcs15_id auth_id;
|
|
|
|
const char * label;
|
|
|
|
unsigned long usage;
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int access_flags;
|
|
|
|
unsigned long value_len; /* User requested length */
|
|
|
|
|
|
|
|
struct sc_pkcs15_der data_value; /* Wrong name: is not DER encoded */
|
|
|
|
};
|
|
|
|
|
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;
|
2010-03-18 09:39:16 +00:00
|
|
|
struct sc_pkcs15_der 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
|
|
|
|
|
2010-02-21 16:21:57 +00:00
|
|
|
|
2010-03-18 09:39:16 +00:00
|
|
|
extern struct sc_pkcs15_object *sc_pkcs15init_new_object(int, const char *,
|
|
|
|
struct sc_pkcs15_id *, void *);
|
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 *,
|
2012-05-25 07:56:15 +00:00
|
|
|
struct sc_app_info *app_info, struct sc_profile **);
|
2002-04-08 15:46:44 +00:00
|
|
|
extern void sc_pkcs15init_unbind(struct sc_profile *);
|
2010-03-18 09:39:16 +00:00
|
|
|
extern void sc_pkcs15init_set_p15card(struct sc_profile *,
|
|
|
|
struct sc_pkcs15_card *);
|
|
|
|
extern int sc_pkcs15init_set_lifecycle(struct sc_card *, int);
|
2010-02-21 16:21:57 +00:00
|
|
|
extern int sc_pkcs15init_erase_card(struct sc_pkcs15_card *,
|
2011-01-11 16:50:30 +00:00
|
|
|
struct sc_profile *, struct sc_aid *);
|
2004-04-17 09:23:26 +00:00
|
|
|
/* XXX could this function be merged with ..._set_lifecycle ?? */
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_pkcs15init_finalize_card(struct sc_card *,
|
2004-04-17 09:23:26 +00:00
|
|
|
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.
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_pkcs15init_change_attrib(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15_object *,
|
|
|
|
int,
|
|
|
|
void *,
|
|
|
|
int);
|
2011-04-15 17:11:38 +00:00
|
|
|
extern int sc_pkcs15init_add_object(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *profile,
|
|
|
|
unsigned int,
|
|
|
|
struct sc_pkcs15_object *);
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_pkcs15init_delete_object(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15_object *);
|
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).
|
|
|
|
*/
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_pkcs15init_update_certificate(struct sc_pkcs15_card *,
|
|
|
|
struct sc_profile *,
|
|
|
|
struct sc_pkcs15_object *,
|
|
|
|
const unsigned char *,
|
|
|
|
size_t);
|
2002-04-02 13:26:42 +00:00
|
|
|
|
|
|
|
extern int sc_pkcs15init_create_file(struct sc_profile *,
|
2010-02-21 16:21:57 +00:00
|
|
|
struct sc_pkcs15_card *, struct sc_file *);
|
2002-04-02 13:26:42 +00:00
|
|
|
extern int sc_pkcs15init_update_file(struct sc_profile *,
|
2010-02-21 16:21:57 +00:00
|
|
|
struct sc_pkcs15_card *, struct sc_file *, void *, unsigned int);
|
2012-04-02 21:40:05 +00:00
|
|
|
extern int sc_pkcs15init_authenticate(struct sc_profile *, struct sc_pkcs15_card *,
|
2010-02-21 16:21:57 +00:00
|
|
|
struct sc_file *, int);
|
2012-04-02 21:40:05 +00:00
|
|
|
extern int sc_pkcs15init_fixup_file(struct sc_profile *, struct sc_pkcs15_card *,
|
2010-02-21 16:21:57 +00:00
|
|
|
struct sc_file *);
|
2011-06-05 15:46:25 +00:00
|
|
|
extern int sc_pkcs15init_get_pin_info(struct sc_profile *, int, struct sc_pkcs15_auth_info *);
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_profile_get_pin_retries(struct sc_profile *, 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-02 13:26:42 +00:00
|
|
|
|
2010-03-17 16:26:07 +00:00
|
|
|
extern int sc_pkcs15init_verify_secret(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
sc_file_t *, unsigned int, int);
|
2005-08-22 09:20:13 +00:00
|
|
|
extern int sc_pkcs15init_delete_by_path(struct sc_profile *,
|
2010-03-18 09:49:49 +00:00
|
|
|
struct sc_pkcs15_card *, const struct sc_path *);
|
2012-04-02 21:40:05 +00:00
|
|
|
extern int sc_pkcs15init_update_any_df(struct sc_pkcs15_card *, struct sc_profile *,
|
2010-03-18 09:39:16 +00:00
|
|
|
struct sc_pkcs15_df *, int);
|
2002-04-11 15:14:12 +00:00
|
|
|
|
2002-06-18 18:18:21 +00:00
|
|
|
/* Erasing the card structure via rm -rf */
|
2010-02-21 16:21:57 +00:00
|
|
|
extern int sc_pkcs15init_erase_card_recursively(struct sc_pkcs15_card *,
|
2010-03-05 10:37:11 +00:00
|
|
|
struct sc_profile *);
|
2010-02-21 16:21:57 +00:00
|
|
|
extern int sc_pkcs15init_rmdir(struct sc_pkcs15_card *, struct sc_profile *,
|
2010-03-18 09:49:49 +00:00
|
|
|
struct sc_file *);
|
2002-06-18 18:18:21 +00:00
|
|
|
|
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
|
|
|
|
2010-03-18 09:39:16 +00:00
|
|
|
extern int sc_pkcs15_create_pin_domain(struct sc_profile *, struct sc_pkcs15_card *,
|
|
|
|
const struct sc_pkcs15_id *, struct sc_file **);
|
2003-10-13 16:13:12 +00:00
|
|
|
|
2012-04-02 21:40:05 +00:00
|
|
|
extern int sc_pkcs15init_get_pin_reference(struct sc_pkcs15_card *,
|
2010-03-05 10:37:11 +00:00
|
|
|
struct sc_profile *, unsigned, int);
|
2010-02-21 16:21:57 +00:00
|
|
|
|
2012-06-07 16:52:03 +00:00
|
|
|
extern int sc_pkcs15init_sanity_check(struct sc_pkcs15_card *, struct sc_profile *);
|
2010-07-02 14:26:29 +00:00
|
|
|
|
2011-01-17 16:28:44 +00:00
|
|
|
extern int sc_pkcs15init_finalize_profile(struct sc_card *card, struct sc_profile *profile,
|
|
|
|
struct sc_aid *aid);
|
|
|
|
|
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);
|
2007-12-17 13:39:20 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_rutoken_ops(void);
|
2008-08-20 05:41:20 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_entersafe_ops(void);
|
2012-06-07 16:52:03 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_epass2003_ops(void);
|
2009-06-24 15:26:37 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_rtecp_ops(void);
|
2009-09-11 09:48:51 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_westcos_ops(void);
|
2009-09-17 07:50:28 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_myeid_ops(void);
|
2010-12-30 14:40:28 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_authentic_ops(void);
|
2011-02-16 10:59:10 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_iasecc_ops(void);
|
2011-04-12 11:36:40 +00:00
|
|
|
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_piv_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 */
|