[35bdadc] | 1 | /*************************************************************************** |
---|
| 2 | smartCard.cpp - description |
---|
| 3 | ------------------- |
---|
| 4 | begin : vie sep 24 2004 |
---|
| 5 | copyright : (C) 2004 by Antonio Araujo, |
---|
| 6 | Victor Bravo |
---|
| 7 | Jorge Redondo |
---|
| 8 | |
---|
| 9 | email : antonioaraujo@funmrd.gov.ve |
---|
| 10 | victorb@funmrd.gov.ve |
---|
| 11 | redondo@funmrd.gov.ve |
---|
| 12 | ***************************************************************************/ |
---|
| 13 | |
---|
| 14 | /*************************************************************************** |
---|
| 15 | * * |
---|
| 16 | * This program is free software; you can redistribute it and/or modify * |
---|
| 17 | * it under the terms of the GNU General Public License as published by * |
---|
| 18 | * the Free Software Foundation; either version 2 of the License, or * |
---|
| 19 | * (at your option) any later version. * |
---|
| 20 | * * |
---|
| 21 | ***************************************************************************/ |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | #ifndef SMARTCARDFUNC_H |
---|
| 25 | #define SMARTCARDFUNC_H |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | #define CK_PTR * |
---|
| 29 | #define CK_DEFINE_FUNCTION(returnType, name) \ |
---|
| 30 | returnType name |
---|
| 31 | #define CK_DECLARE_FUNCTION(returnType, name) \ |
---|
| 32 | returnType name |
---|
| 33 | #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ |
---|
| 34 | returnType (* name) |
---|
| 35 | #define CK_CALLBACK_FUNCTION(returnType, name) \ |
---|
| 36 | returnType (* name) |
---|
| 37 | #ifndef NULL_PTR |
---|
| 38 | #define NULL_PTR 0 |
---|
| 39 | #endif |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | #include <openssl/evp.h> |
---|
| 43 | #include <openssl/rsa.h> |
---|
| 44 | #include <openssl/pem.h> |
---|
| 45 | #include <openssl/err.h> |
---|
| 46 | |
---|
| 47 | #include <openssl/asn1.h> |
---|
| 48 | #include <openssl/objects.h> |
---|
| 49 | #include <openssl/x509.h> |
---|
| 50 | #include <openssl/x509v3.h> |
---|
| 51 | #include <openssl/pkcs12.h> |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | #include "pkcs11.h" |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | // declaracion de la estructura biginteger_t utilizada para la conversion de los atributos |
---|
| 60 | // modulo y exponente publico a un objeto EVP_PKEY |
---|
| 61 | typedef struct biginteger { |
---|
| 62 | CK_BYTE *big_value; |
---|
| 63 | CK_ULONG big_value_len; |
---|
| 64 | } biginteger_t; |
---|
| 65 | |
---|
| 66 | //static |
---|
| 67 | int cvt_bigint2bn(biginteger_t *from, BIGNUM **to); |
---|
| 68 | |
---|
| 69 | // funcion para copiar una plantilla de atributos a un biginteger_t |
---|
| 70 | void copy_attr_to_bigint(CK_ATTRIBUTE_PTR attr, biginteger_t *big); |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | #endif // SMARTCARDFUNC_H |
---|
| 74 | |
---|