⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kopenssl.h

📁 konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版本源码包.
💻 H
📖 第 1 页 / 共 2 页
字号:
/* This file is part of the KDE libraries   Copyright (C) 2001-2003 George Staikos <staikos@kde.org>    This library is free software; you can redistribute it and/or   modify it under the terms of the GNU Library General Public   License version 2 as published by the Free Software Foundation.    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   Library General Public License for more details.    You should have received a copy of the GNU Library General Public License   along with this library; see the file COPYING.LIB.  If not, write to   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,   Boston, MA 02110-1301, USA.*/// IF YOU ARE USING THIS CLASS, YOU ARE MAKING A MISTAKE.#ifndef __KOPENSSLPROXY_H #define __KOPENSSLPROXY_H#define KOSSL KOpenSSLProxyclass KOpenSSLProxyPrivate;#include <klibloader.h>#ifdef Q_WS_WIN#include "ksslconfig_win.h"#else#include "ksslconfig.h"#endif#ifdef KSSL_HAVE_SSL#define crypt _openssl_crypt#include <openssl/ssl.h>#include <openssl/x509.h>#include <openssl/x509v3.h>#include <openssl/pem.h>#include <openssl/bio.h>#include <openssl/rand.h>#include <openssl/asn1.h>#include <openssl/pkcs7.h>#include <openssl/pkcs12.h>#include <openssl/evp.h>#include <openssl/stack.h>#include <openssl/bn.h>#undef crypt#endif#include <kstaticdeleter.h>/** * Dynamically load and wrap OpenSSL. * * @author George Staikos <staikos@kde.org> * @see KSSL * @short KDE OpenSSL Wrapper * @internal */class KIO_EXPORT KOpenSSLProxy {friend class KStaticDeleter<KOpenSSLProxy>;public:   /**    * Return an instance of class KOpenSSLProxy *    * You cannot delete this object.  It is a singleton class.    */   static KOpenSSLProxy *self();   /**    *   Return true of libcrypto was found and loaded    */   bool hasLibCrypto() const;   /**    *   Return true of libssl was found and loaded    */   bool hasLibSSL() const;   /**    *   Destroy the class and start over - don't use this unless you know    *   what you are doing.    */   void destroy();   // Here are the symbols that we need.#ifdef KSSL_HAVE_SSL   /*    *   SSL_connect - initiate the TLS/SSL handshake with an TLS/SSL server    */   int SSL_connect(SSL *ssl);   /*    *   SSL_accept - initiate the TLS/SSL handshake with an TLS/SSL server    */   int SSL_accept(SSL *ssl);   /*    *   SSL_get_error - get the error code    */   int SSL_get_error(SSL *ssl, int rc);   /*    *   SSL_read - read bytes from a TLS/SSL connection.    */   int SSL_read(SSL *ssl, void *buf, int num);   /*    *   SSL_write - write bytes to a TLS/SSL connection.    */   int SSL_write(SSL *ssl, const void *buf, int num);   /*    *   SSL_new - create a new SSL structure for a connection    */   SSL *SSL_new(SSL_CTX *ctx);   /*    *   SSL_free - free an allocated SSL structure    */   void SSL_free(SSL *ssl);   /*    *   SSL_shutdown - shutdown an allocated SSL connection    */   int SSL_shutdown(SSL *ssl);   /*    *   SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions    */   SSL_CTX *SSL_CTX_new(SSL_METHOD *method);   /*    *   SSL_CTX_free - free an allocated SSL_CTX object    */   void SSL_CTX_free(SSL_CTX *ctx);   /*    *   SSL_set_fd - connect the SSL object with a file descriptor    */   int SSL_set_fd(SSL *ssl, int fd);   /*    *   SSL_pending - obtain number of readable bytes buffered in an SSL object    */   int SSL_pending(SSL *ssl);   /*    *   SSL_peek - obtain bytes buffered in an SSL object    */   int SSL_peek(SSL *ssl, void *buf, int num);   /*    *   SSL_CTX_set_cipher_list - choose list of available SSL_CIPHERs    */   int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str);   /*    *   SSL_CTX_set_verify - set peer certificate verification parameters    */   void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,                         int (*verify_callback)(int, X509_STORE_CTX *));   /*    *   SSL_use_certificate - load certificate    */   int SSL_use_certificate(SSL *ssl, X509 *x);   /*    *   SSL_get_current_cipher - get SSL_CIPHER of a connection    */   SSL_CIPHER *SSL_get_current_cipher(SSL *ssl);   /*    *   SSL_set_options - manipulate SSL engine options    *   Note: These are all mapped to SSL_ctrl so call them as the comment    *         specifies but know that they use SSL_ctrl.  They are #define    *         so they will map to the one in this class if called as a    *         member function of this class.    */   /* long SSL_set_options(SSL *ssl, long options); */   /*   Returns 0 if not reused, 1 if session id is reused */   /*   int SSL_session_reused(SSL *ssl); */   long    SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg);   /*    *   RAND_egd - set the path to the EGD    */   int RAND_egd(const char *path);   /*    *   RAND_file_name     */   const char *RAND_file_name(char *buf, size_t num);   /*    *   RAND_load_file     */   int RAND_load_file(const char *filename, long max_bytes);   /*    *   RAND_write_file     */   int RAND_write_file(const char *filename);   /*    *   TLSv1_client_method - return a TLSv1 client method object    */   SSL_METHOD *TLSv1_client_method();   /*    *   SSLv2_client_method - return a SSLv2 client method object    */   SSL_METHOD *SSLv2_client_method();   /*    *   SSLv3_client_method - return a SSLv3 client method object    */   SSL_METHOD *SSLv3_client_method();   /*    *   SSLv23_client_method - return a SSLv23 client method object    */   SSL_METHOD *SSLv23_client_method();   /*    *   SSL_get_peer_certificate - return the peer's certificate    */   X509 *SSL_get_peer_certificate(SSL *s);   /*    *   SSL_get_peer_cert_chain - get the peer's certificate chain    */   STACK_OF(X509) *SSL_get_peer_cert_chain(SSL *s);   /*    *   SSL_CIPHER_get_bits - get the number of bits in this cipher    */   int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits);   /*    *   SSL_CIPHER_get_version - get the version of this cipher    */   char *SSL_CIPHER_get_version(SSL_CIPHER *c);   /*    *   SSL_CIPHER_get_name - get the name of this cipher    */   const char *SSL_CIPHER_get_name(SSL_CIPHER *c);   /*    *   SSL_CIPHER_description - get the description of this cipher    */   char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size);   /*    *   SSL_CTX_use_PrivateKey - set the private key for the session.    *                          - for use with client certificates    */   int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);   /*    *   SSL_CTX_use_certificate - set the client certificate for the session.    */   int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);   /*    *   d2i_X509 - Covert a text representation of X509 to an X509 object    */   X509 * d2i_X509(X509 **a,unsigned char **pp,long length);   /*    *   i2d_X509 - Covert an X509 object into a text representation    */   int i2d_X509(X509 *a,unsigned char **pp);   /*    *   X509_cmp - compare two X509 objects    */   int X509_cmp(X509 *a, X509 *b);   /*    *   X509_dup - duplicate an X509 object    */   X509 *X509_dup(X509 *x509);   /*    *   X509_STORE_CTX_new - create an X509 store context    */   X509_STORE_CTX *X509_STORE_CTX_new(void);   /*    *   X509_STORE_CTX_free - free up an X509 store context    */   void X509_STORE_CTX_free(X509_STORE_CTX *v);   /*    *   X509_STORE_CTX_set_chain - set the certificate chain    */   void X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x);   /*    *   X509_STORE_CTX_set_purpose - set the purpose of the certificate     */   void X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose);   /*    *   X509_verify_cert - verify the certificate    */   int X509_verify_cert(X509_STORE_CTX *v);   /*    *   X509_STORE_new - create an X509 store    */   X509_STORE *X509_STORE_new(void);   /*    *   X509_STORE_free - free up an X509 store    */   void X509_STORE_free(X509_STORE *v);   /*    *   X509_free - free up an X509    */   void X509_free(X509 *v);   /*    *   X509_NAME_oneline - return the X509 data in a string    */   char *X509_NAME_oneline(X509_NAME *a, char *buf, int size);   /*    *   X509_get_subject_name - return the X509_NAME for the subject field    */   X509_NAME *X509_get_subject_name(X509 *a);   /*    *   X509_get_issuer_name - return the X509_NAME for the issuer field    */   X509_NAME *X509_get_issuer_name(X509 *a);   /*    *   X509_STORE_add_lookup - add a lookup file/method to an X509 store    */   X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);   /*    *   X509_LOOKUP_file - Definition of the LOOKUP_file method    */   X509_LOOKUP_METHOD *X509_LOOKUP_file(void);   /*    *   X509_LOOKUP_free - Free an X509_LOOKUP    */   void X509_LOOKUP_free(X509_LOOKUP *x);   /*    *   X509_LOOKUP_ctrl - This is not normally called directly (use macros)    */   int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret);   /*    *   X509_STORE_CTX_init - initialize an X509 STORE context    */   void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain);   /*    *   CRYPTO_free - free up an internally allocated object    */   void CRYPTO_free(void *x);   /*    *   BIO_new - create new BIO    */   BIO *BIO_new(BIO_METHOD *type);   /*    *   BIO methods - only one defined here yet    */   BIO_METHOD *BIO_s_mem(void);   /*    *   BIO_new_fp - nastiness called BIO - used to create BIO* from FILE*    */   BIO *BIO_new_fp(FILE *stream, int close_flag);   /*    *   BIO_new_mem_buf - read only BIO from memory region    */   BIO *BIO_new_mem_buf(void *buf, int len);   /*    *   BIO_free - nastiness called BIO - used to destroy BIO*    */   int BIO_free(BIO *a);   /*    *   BIO_ctrl - BIO control method    */   long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);   /*    *   BIO_write - equivalent to ::write for BIO    */   int BIO_write(BIO *b, const void *data, int len);   /*    *   PEM_write_bio_X509 - write a PEM encoded cert to a BIO*    */   int PEM_write_bio_X509(BIO *bp, X509 *x);   /*    *   X509_asn1_meth - used for netscape output

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -