openssl_x509.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00017 #include <openssl/rand.h>
00018 #include <openssl/evp.h>
00019 #include <openssl/pem.h>
00020 #include <openssl/bio.h>
00021 #include <openssl/rand.h>
00022 #include <openssl_constants.h>
00023 #include <openssl_pkey.h>
00024 #include <axis2_util.h>
00025 #include <openssl/pkcs12.h>
00026 #include <oxs_error.h>
00031 #ifndef OPENSSL_X509_H
00032 #define OPENSSL_X509_H
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00043 typedef enum {
00044     OPENSSL_X509_FORMAT_PEM = 0,
00045     OPENSSL_X509_FORMAT_DER,
00046     OPENSSL_X509_FORMAT_PKCS12 
00047 } openssl_x509_format_t;
00048 
00049 typedef enum {
00050     OPENSSL_X509_INFO_SUBJECT = 0,
00051     OPENSSL_X509_INFO_ISSUER ,
00052     OPENSSL_X509_INFO_VALID_FROM ,
00053     OPENSSL_X509_INFO_VALID_TO ,
00054     OPENSSL_X509_INFO_FINGER ,
00055     OPENSSL_X509_INFO_SIGNATURE ,
00056     OPENSSL_X509_INFO_VERSION ,
00057     OPENSSL_X509_INFO_PUBKEY ,
00058     OPENSSL_X509_INFO_PUBKEY_ALGO ,
00059     OPENSSL_X509_INFO_DATA_CERT 
00060 } openssl_x509_info_type_t;
00061 
00062 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00063 openssl_x509_load_from_buffer(const axis2_env_t *env,
00064     axis2_char_t *b64_encoded_buf,
00065     X509 **cert);
00066 
00067 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00068 openssl_x509_load_from_pem(const axis2_env_t *env,
00069     axis2_char_t *filename,
00070         X509 **cert);
00071 
00072 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00073 openssl_x509_load_from_pkcs12(const axis2_env_t *env,
00074     axis2_char_t *filename,
00075     axis2_char_t *password,
00076     X509 **cert,
00077     EVP_PKEY **pkey,
00078     STACK_OF(X509) **ca);
00079 
00080 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00081 openssl_x509_load_certificate(const axis2_env_t *env,
00082     openssl_x509_format_t format,
00083     axis2_char_t *filename,
00084     axis2_char_t *password,
00085     X509 **cert);
00086 
00087 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00088 openssl_x509_get_cert_data(const axis2_env_t *env,
00089     X509 *cert);
00090 
00091 
00092 AXIS2_EXTERN int AXIS2_CALL
00093 openssl_x509_get_serial(const axis2_env_t *env,
00094     X509 *cert);
00095 
00096 AXIS2_EXTERN unsigned long AXIS2_CALL
00097 openssl_x509_get_subject_name_hash(const axis2_env_t *env,
00098     X509 *cert);
00099 
00100 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00101 openssl_x509_get_pubkey(const axis2_env_t *env,
00102     X509 *cert,
00103     EVP_PKEY **pubkey);
00104 
00105 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00106 openssl_x509_get_subject_key_identifier(const axis2_env_t *env,
00107     X509 *cert);
00108 
00109 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00110 openssl_x509_get_info(const axis2_env_t *env,
00111     openssl_x509_info_type_t type,
00112         X509 *cert);
00113 
00114 AXIS2_EXTERN void AXIS2_CALL
00115 openssl_x509_print(const axis2_env_t *env,
00116     X509 *cert);
00117 
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122 
00123 #endif    /* OPENSSL_X509_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1