~ubuntu-branches/ubuntu/natty/libp11/natty

« back to all changes in this revision

Viewing changes to src/libp11.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-08-16 23:45:00 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090816234500-rmcz7zu0bm46pgv7
Tags: 0.2.6-1
* New upstream release.
* debian/compat: Upgrade to version 7.
* debian/rules, debian/control: Use dh instead of debhelper.
* debian/control: Upgrade Standards-Version to 3.8.3.
* debian/libp11-1.install,  debian/libp11-1.shlibs, debian/libp11-1.symbols,
  debian/control: Rename libp11-0 to libp11-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
typedef struct PKCS11_key_st {
54
54
        char *label;
55
55
        unsigned char *id;
56
 
        int id_len;
 
56
        size_t id_len;
57
57
        unsigned char isPrivate;        /**< private key present? */
58
58
        unsigned char needLogin;        /**< login to read private key? */
59
59
        EVP_PKEY *evp_key;              /**< initially NULL, need to call PKCS11_load_key */
64
64
typedef struct PKCS11_cert_st {
65
65
        char *label;
66
66
        unsigned char *id;
67
 
        int id_len;
 
67
        size_t id_len;
68
68
        X509 *x509;
69
69
        void *_private;
70
70
} PKCS11_CERT;
112
112
 *
113
113
 * @return none
114
114
 */
115
 
extern void *PKCS11_CTX_init_args(PKCS11_CTX * ctx, const char * init_args);
 
115
extern void PKCS11_CTX_init_args(PKCS11_CTX * ctx, const char * init_args);
116
116
 
117
117
/**
118
118
 * Load a PKCS#11 module
160
160
                        PKCS11_SLOT **slotsp, unsigned int *nslotsp);
161
161
 
162
162
/**
 
163
 * Get the slot_id from a slot as it is stored in private
 
164
 *
 
165
 * @param slotp pointer on a slot
 
166
 * @retval the slotid 
 
167
 */
 
168
extern unsigned long PKCS11_get_slotid_from_slot(PKCS11_SLOT *slotp);
 
169
 
 
170
/**
163
171
 * Free the list of slots allocated by PKCS11_enumerate_slots()
164
172
 *
165
173
 * @param ctx context allocated by PKCS11_CTX_new()
291
299
 * @retval -1 error
292
300
 */
293
301
 
294
 
extern int PKCS11_generate_key(PKCS11_TOKEN * token, int algorithm, unsigned int bits, char *label, unsigned char* id, unsigned int id_len);
 
302
extern int PKCS11_generate_key(PKCS11_TOKEN * token, int algorithm, unsigned int bits, char *label, unsigned char* id, size_t id_len);
295
303
 
296
304
/**
297
305
 * Store private key on a token
304
312
 * @retval 0 success
305
313
 * @retval -1 error
306
314
 */
307
 
extern int PKCS11_store_private_key(PKCS11_TOKEN * token, EVP_PKEY * pk, char *label, unsigned char *id, unsigned int id_len);
 
315
extern int PKCS11_store_private_key(PKCS11_TOKEN * token, EVP_PKEY * pk, char *label, unsigned char *id, size_t id_len);
308
316
 
309
317
/**
310
318
 * Store public key on a token
317
325
 * @retval 0 success
318
326
 * @retval -1 error
319
327
 */
320
 
extern int PKCS11_store_public_key(PKCS11_TOKEN * token, EVP_PKEY * pk, char *label, unsigned char *id, unsigned int id_len);
 
328
extern int PKCS11_store_public_key(PKCS11_TOKEN * token, EVP_PKEY * pk, char *label, unsigned char *id, size_t id_len);
321
329
 
322
330
/**
323
331
 * Store certificate on a token
332
340
 * @retval -1 error
333
341
 */
334
342
extern int PKCS11_store_certificate(PKCS11_TOKEN * token, X509 * x509,
335
 
                char *label, unsigned char *id, unsigned int id_len,
 
343
                char *label, unsigned char *id, size_t id_len,
336
344
                PKCS11_CERT **ret_cert);
337
345
 
338
346
/* rsa private key operations */