# openssl_pkey.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 <axis2_util.h>
    00024
    00030 #ifndef OPENSSL_PKEY_H
    00031 #define OPENSSL_PKEY_H
    00032
    00033 #ifdef __cplusplus
    00034 extern "C" {
    00035 #endif
    00036
    00042 #define OPENSSL_PKEY_TYPE_UNKNOWN        0
    00043 #define OPENSSL_PKEY_TYPE_PUBLIC_KEY     1
    00044 #define OPENSSL_PKEY_TYPE_PRIVATE_KEY    2
    00045
    00046
    00048     typedef struct openssl_pkey_t openssl_pkey_t;
    00049
    00050
    00051
    00052     EVP_PKEY *AXIS2_CALL
    00053     openssl_pkey_get_key(
    00054         const openssl_pkey_t *pkey,
    00055         const axutil_env_t *env
    00056     );
    00057
    00058     axis2_char_t *AXIS2_CALL
    00059     openssl_pkey_get_name(
    00060         const openssl_pkey_t *pkey,
    00061         const axutil_env_t *env
    00062     );
    00063
    00064     int AXIS2_CALL
    00065     openssl_pkey_get_size(
    00066         const openssl_pkey_t *pkey,
    00067         const axutil_env_t *env
    00068     );
    00069
    00070     int AXIS2_CALL
    00071     openssl_pkey_get_type(
    00072         const openssl_pkey_t *pkey,
    00073         const axutil_env_t *env
    00074     );
    00075
    00076
    00077     axis2_status_t AXIS2_CALL
    00078     openssl_pkey_set_key(
    00079         openssl_pkey_t *pkey,
    00080         const axutil_env_t *env,
    00081         EVP_PKEY *key
    00082     );
    00083
    00084     axis2_status_t AXIS2_CALL
    00085     openssl_pkey_set_name(
    00086         openssl_pkey_t *pkey,
    00087         const axutil_env_t *env,
    00088         axis2_char_t *name
    00089     );
    00090
    00091     axis2_status_t AXIS2_CALL
    00092     openssl_pkey_set_type(
    00093         openssl_pkey_t *pkey,
    00094         const axutil_env_t *env,
    00095         int type
    00096     );
    00097
    00098     axis2_status_t AXIS2_CALL
    00099     openssl_pkey_load(
    00100         openssl_pkey_t *pkey,
    00101         const axutil_env_t *env,
    00102         axis2_char_t *filename,
    00103         axis2_char_t *password
    00104     );
    00105
    00106     axis2_status_t AXIS2_CALL
    00107     openssl_pkey_populate(
    00108         openssl_pkey_t *pkey,
    00109         const axutil_env_t *env,
    00110         EVP_PKEY *key,
    00111         axis2_char_t *name,
    00112         int type
    00113     );
    00114
    00115     axis2_status_t AXIS2_CALL
    00116     openssl_pkey_free(
    00117         openssl_pkey_t *pkey,
    00118         const axutil_env_t *env
    00119     );
    00120
    00121     axis2_status_t AXIS2_CALL
    00122     openssl_pkey_increment_ref(
    00123         openssl_pkey_t *pkey,
    00124         const axutil_env_t *env);
    00125     /*Create function*/
    00126     AXIS2_EXTERN openssl_pkey_t *AXIS2_CALL
    00127     openssl_pkey_create(const axutil_env_t *env);
    00128
    00130 #ifdef __cplusplus
    00131 }
    00132 #endif
    00133
    00134 #endif    /* OPENSSL_PKEY_H */