diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-06-28 19:24:58 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-06-28 19:24:58 +0000 |
commit | efb388dd12fe50e82ebc273ed7513c94463c938a (patch) | |
tree | d7c5f7e3624baa72de3d71da9813c087b3f71a62 /includes | |
parent | f83e4bd5ade7f780ef9ef55a7ed32ae5af7830a6 (diff) | |
download | gnutls-efb388dd12fe50e82ebc273ed7513c94463c938a.tar.gz |
*** empty log message ***
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Makefile.am | 2 | ||||
-rw-r--r-- | includes/gnutls/Makefile.am | 2 | ||||
-rw-r--r-- | includes/gnutls/pkcs12.h | 86 | ||||
-rw-r--r-- | includes/gnutls/x509.h | 51 |
4 files changed, 88 insertions, 53 deletions
diff --git a/includes/Makefile.am b/includes/Makefile.am index bcfa3d8787..a363f40443 100644 --- a/includes/Makefile.am +++ b/includes/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in nobase_include_HEADERS = gnutls/extra.h gnutls/openssl.h gnutls/gnutls.h \ - gnutls/compat4.h gnutls/x509.h gnutls/compat8.h + gnutls/compat4.h gnutls/x509.h gnutls/compat8.h gnutls/pkcs12.h SUBDIRS = gnutls diff --git a/includes/gnutls/Makefile.am b/includes/gnutls/Makefile.am index c64034e78c..d7914a5e2f 100644 --- a/includes/gnutls/Makefile.am +++ b/includes/gnutls/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = extra.h openssl.h gnutls.h compat4.h x509.h compat8.h +EXTRA_DIST = extra.h openssl.h gnutls.h compat4.h x509.h compat8.h pkcs12.h diff --git a/includes/gnutls/pkcs12.h b/includes/gnutls/pkcs12.h new file mode 100644 index 0000000000..a27951edfc --- /dev/null +++ b/includes/gnutls/pkcs12.h @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2003 Nikos Mavroyanopoulos + * + * This file is part of GNUTLS. + * + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef GNUTLS_PKCS12_H +# define GNUTLS_PKCS12_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <gnutls/x509.h> + +/* PKCS12 structures handling + */ +struct gnutls_pkcs12_int; +typedef struct gnutls_pkcs12_int* gnutls_pkcs12; + +struct gnutls_pkcs12_bag_int; +typedef struct gnutls_pkcs12_bag_int* gnutls_pkcs12_bag; + +int gnutls_pkcs12_init(gnutls_pkcs12 * pkcs12); +void gnutls_pkcs12_deinit(gnutls_pkcs12 pkcs12); +int gnutls_pkcs12_import(gnutls_pkcs12 pkcs12, const gnutls_datum * data, + gnutls_x509_crt_fmt format, unsigned int flags); +int gnutls_pkcs12_get_bag(gnutls_pkcs12 pkcs12, + int indx, gnutls_pkcs12_bag bag); +int gnutls_pkcs12_set_bag(gnutls_pkcs12 pkcs12, gnutls_pkcs12_bag bag); + +int gnutls_pkcs12_generate_mac(gnutls_pkcs12 pkcs12, const char* pass); +int gnutls_pkcs12_verify_mac(gnutls_pkcs12 pkcs12, const char* pass); + +int gnutls_pkcs12_bag_decrypt(gnutls_pkcs12_bag bag, const char* pass); +int gnutls_pkcs12_bag_encrypt(gnutls_pkcs12_bag bag, const char* pass, unsigned int flags); + +typedef enum gnutls_pkcs12_bag_type { + GNUTLS_BAG_EMPTY = 0, + + GNUTLS_BAG_PKCS8_ENCRYPTED_KEY=1, + GNUTLS_BAG_PKCS8_KEY, + GNUTLS_BAG_CERTIFICATE, + GNUTLS_BAG_CRL, + GNUTLS_BAG_ENCRYPTED=10, + GNUTLS_BAG_UNKNOWN=20 +} gnutls_pkcs12_bag_type; + +gnutls_pkcs12_bag_type gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag bag, int indx); +int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag bag, int indx, gnutls_datum* data); +int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag bag, gnutls_pkcs12_bag_type type, + const gnutls_datum* data); + +int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag * bag); +void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag bag); +int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag bag); + +int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag bag, int indx, + gnutls_datum* id); +int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag bag, int indx, + const gnutls_datum* id); + +int gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag bag, int indx, + char **name); +int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag bag, int indx, + const char* name); + +#ifdef __cplusplus +} +#endif +#endif /* GNUTLS_PKCS12_H */ diff --git a/includes/gnutls/x509.h b/includes/gnutls/x509.h index 60c3a64f3a..ce87e4750e 100644 --- a/includes/gnutls/x509.h +++ b/includes/gnutls/x509.h @@ -268,57 +268,6 @@ int gnutls_x509_crq_get_challenge_password(gnutls_x509_crq crq, int gnutls_x509_crq_export( gnutls_x509_crq crq, gnutls_x509_crt_fmt format, unsigned char* output_data, int* output_data_size); -/* PKCS12 structures handling - */ -struct gnutls_pkcs12_int; -typedef struct gnutls_pkcs12_int* gnutls_pkcs12; - -struct gnutls_pkcs12_bag_int; -typedef struct gnutls_pkcs12_bag_int* gnutls_pkcs12_bag; - -int gnutls_pkcs12_init(gnutls_pkcs12 * pkcs12); -void gnutls_pkcs12_deinit(gnutls_pkcs12 pkcs12); -int gnutls_pkcs12_import(gnutls_pkcs12 pkcs12, const gnutls_datum * data, - gnutls_x509_crt_fmt format, unsigned int flags); -int gnutls_pkcs12_get_bag(gnutls_pkcs12 pkcs12, - int indx, gnutls_pkcs12_bag bag); -int gnutls_pkcs12_set_bag(gnutls_pkcs12 pkcs12, gnutls_pkcs12_bag bag); - -int gnutls_pkcs12_generate_mac(gnutls_pkcs12 pkcs12, const char* pass); -int gnutls_pkcs12_verify_mac(gnutls_pkcs12 pkcs12, const char* pass); - -int gnutls_pkcs12_bag_decrypt(gnutls_pkcs12_bag bag, const char* pass); -int gnutls_pkcs12_bag_encrypt(gnutls_pkcs12_bag bag, const char* pass, unsigned int flags); - -typedef enum gnutls_pkcs12_bag_type { - GNUTLS_BAG_EMPTY = 0, - - GNUTLS_BAG_PKCS8_ENCRYPTED_KEY=1, - GNUTLS_BAG_PKCS8_KEY, - GNUTLS_BAG_CERTIFICATE, - GNUTLS_BAG_CRL, - GNUTLS_BAG_ENCRYPTED=10, - GNUTLS_BAG_UNKNOWN=20 -} gnutls_pkcs12_bag_type; - -gnutls_pkcs12_bag_type gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag bag, int indx); -int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag bag, int indx, gnutls_datum* data); -int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag bag, gnutls_pkcs12_bag_type type, - const gnutls_datum* data); - -int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag * bag); -void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag bag); -int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag bag); - -int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag bag, int indx, - gnutls_datum* id); -int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag bag, int indx, - const gnutls_datum* id); - -int gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag bag, int indx, - char **name); -int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag bag, int indx, - const char* name); #ifdef __cplusplus |