kio Library API Documentation

kopenssl.h

00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001-2003 George Staikos <staikos@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 00019 00020 // IF YOU ARE USING THIS CLASS, YOU ARE MAKING A MISTAKE. 00021 00022 #ifndef __KOPENSSLPROXY_H 00023 #define __KOPENSSLPROXY_H 00024 00025 #define KOSSL KOpenSSLProxy 00026 class KOpenSSLProxyPrivate; 00027 00028 #include "ksslconfig.h" 00029 #include <klibloader.h> 00030 00031 #ifdef KSSL_HAVE_SSL 00032 #define crypt _openssl_crypt 00033 #include <openssl/ssl.h> 00034 #include <openssl/x509.h> 00035 #include <openssl/x509v3.h> 00036 #include <openssl/pem.h> 00037 #include <openssl/bio.h> 00038 #include <openssl/rand.h> 00039 #include <openssl/asn1.h> 00040 #include <openssl/pkcs7.h> 00041 #include <openssl/pkcs12.h> 00042 #include <openssl/evp.h> 00043 #include <openssl/stack.h> 00044 #include <openssl/bn.h> 00045 #undef crypt 00046 #endif 00047 00048 #include <kstaticdeleter.h> 00049 00058 class KOpenSSLProxy { 00059 friend class KStaticDeleter<KOpenSSLProxy>; 00060 public: 00061 00066 static KOpenSSLProxy *self(); 00067 00071 bool hasLibCrypto() const; 00072 00076 bool hasLibSSL() const; 00077 00082 void destroy(); 00083 00084 // Here are the symbols that we need. 00085 #ifdef KSSL_HAVE_SSL 00086 00087 /* 00088 * SSL_connect - initiate the TLS/SSL handshake with an TLS/SSL server 00089 */ 00090 int SSL_connect(SSL *ssl); 00091 00092 /* 00093 * SSL_accept - initiate the TLS/SSL handshake with an TLS/SSL server 00094 */ 00095 int SSL_accept(SSL *ssl); 00096 00097 /* 00098 * SSL_get_error - get the error code 00099 */ 00100 int SSL_get_error(SSL *ssl, int rc); 00101 00102 /* 00103 * SSL_read - read bytes from a TLS/SSL connection. 00104 */ 00105 int SSL_read(SSL *ssl, void *buf, int num); 00106 00107 /* 00108 * SSL_write - write bytes to a TLS/SSL connection. 00109 */ 00110 int SSL_write(SSL *ssl, const void *buf, int num); 00111 00112 /* 00113 * SSL_new - create a new SSL structure for a connection 00114 */ 00115 SSL *SSL_new(SSL_CTX *ctx); 00116 00117 /* 00118 * SSL_free - free an allocated SSL structure 00119 */ 00120 void SSL_free(SSL *ssl); 00121 00122 /* 00123 * SSL_shutdown - shutdown an allocated SSL connection 00124 */ 00125 int SSL_shutdown(SSL *ssl); 00126 00127 /* 00128 * SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions 00129 */ 00130 SSL_CTX *SSL_CTX_new(SSL_METHOD *method); 00131 00132 /* 00133 * SSL_CTX_free - free an allocated SSL_CTX object 00134 */ 00135 void SSL_CTX_free(SSL_CTX *ctx); 00136 00137 /* 00138 * SSL_set_fd - connect the SSL object with a file descriptor 00139 */ 00140 int SSL_set_fd(SSL *ssl, int fd); 00141 00142 /* 00143 * SSL_pending - obtain number of readable bytes buffered in an SSL object 00144 */ 00145 int SSL_pending(SSL *ssl); 00146 00147 /* 00148 * SSL_peek - obtain bytes buffered in an SSL object 00149 */ 00150 int SSL_peek(SSL *ssl, void *buf, int num); 00151 00152 /* 00153 * SSL_CTX_set_cipher_list - choose list of available SSL_CIPHERs 00154 */ 00155 int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); 00156 00157 /* 00158 * SSL_CTX_set_verify - set peer certificate verification parameters 00159 */ 00160 void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, 00161 int (*verify_callback)(int, X509_STORE_CTX *)); 00162 00163 /* 00164 * SSL_use_certificate - load certificate 00165 */ 00166 int SSL_use_certificate(SSL *ssl, X509 *x); 00167 00168 /* 00169 * SSL_get_current_cipher - get SSL_CIPHER of a connection 00170 */ 00171 SSL_CIPHER *SSL_get_current_cipher(SSL *ssl); 00172 00173 /* 00174 * SSL_set_options - manipulate SSL engine options 00175 * Note: These are all mapped to SSL_ctrl so call them as the comment 00176 * specifies but know that they use SSL_ctrl. They are #define 00177 * so they will map to the one in this class if called as a 00178 * member function of this class. 00179 */ 00180 /* long SSL_set_options(SSL *ssl, long options); */ 00181 /* Returns 0 if not reused, 1 if session id is reused */ 00182 /* int SSL_session_reused(SSL *ssl); */ 00183 long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg); 00184 00185 /* 00186 * RAND_egd - set the path to the EGD 00187 */ 00188 int RAND_egd(const char *path); 00189 00190 00191 /* 00192 * RAND_file_name 00193 */ 00194 const char *RAND_file_name(char *buf, size_t num); 00195 00196 00197 /* 00198 * RAND_load_file 00199 */ 00200 int RAND_load_file(const char *filename, long max_bytes); 00201 00202 00203 /* 00204 * RAND_write_file 00205 */ 00206 int RAND_write_file(const char *filename); 00207 00208 00209 /* 00210 * TLSv1_client_method - return a TLSv1 client method object 00211 */ 00212 SSL_METHOD *TLSv1_client_method(); 00213 00214 00215 /* 00216 * SSLv2_client_method - return a SSLv2 client method object 00217 */ 00218 SSL_METHOD *SSLv2_client_method(); 00219 00220 00221 /* 00222 * SSLv3_client_method - return a SSLv3 client method object 00223 */ 00224 SSL_METHOD *SSLv3_client_method(); 00225 00226 00227 /* 00228 * SSLv23_client_method - return a SSLv23 client method object 00229 */ 00230 SSL_METHOD *SSLv23_client_method(); 00231 00232 00233 /* 00234 * SSL_get_peer_certificate - return the peer's certificate 00235 */ 00236 X509 *SSL_get_peer_certificate(SSL *s); 00237 00238 00239 /* 00240 * SSL_get_peer_cert_chain - get the peer's certificate chain 00241 */ 00242 STACK_OF(X509) *SSL_get_peer_cert_chain(SSL *s); 00243 00244 /* 00245 * SSL_CIPHER_get_bits - get the number of bits in this cipher 00246 */ 00247 int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits); 00248 00249 00250 /* 00251 * SSL_CIPHER_get_version - get the version of this cipher 00252 */ 00253 char *SSL_CIPHER_get_version(SSL_CIPHER *c); 00254 00255 00256 /* 00257 * SSL_CIPHER_get_name - get the name of this cipher 00258 */ 00259 const char *SSL_CIPHER_get_name(SSL_CIPHER *c); 00260 00261 00262 /* 00263 * SSL_CIPHER_description - get the description of this cipher 00264 */ 00265 char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); 00266 00267 00268 /* 00269 * SSL_CTX_use_PrivateKey - set the private key for the session. 00270 * - for use with client certificates 00271 */ 00272 int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); 00273 00274 00275 /* 00276 * SSL_CTX_use_certificate - set the client certificate for the session. 00277 */ 00278 int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); 00279 00280 00281 /* 00282 * d2i_X509 - Covert a text representation of X509 to an X509 object 00283 */ 00284 X509 * d2i_X509(X509 **a,unsigned char **pp,long length); 00285 00286 00287 /* 00288 * i2d_X509 - Covert an X509 object into a text representation 00289 */ 00290 int i2d_X509(X509 *a,unsigned char **pp); 00291 00292 00293 /* 00294 * X509_cmp - compare two X509 objects 00295 */ 00296 int X509_cmp(X509 *a, X509 *b); 00297 00298 00299 /* 00300 * X509_dup - duplicate an X509 object 00301 */ 00302 X509 *X509_dup(X509 *x509); 00303 00304 00305 /* 00306 * X509_STORE_CTX_new - create an X509 store context 00307 */ 00308 X509_STORE_CTX *X509_STORE_CTX_new(void); 00309 00310 00311 /* 00312 * X509_STORE_CTX_free - free up an X509 store context 00313 */ 00314 void X509_STORE_CTX_free(X509_STORE_CTX *v); 00315 00316 00317 /* 00318 * X509_STORE_CTX_set_chain - set the certificate chain 00319 */ 00320 void X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x); 00321 00322 /* 00323 * X509_STORE_CTX_set_purpose - set the purpose of the certificate 00324 */ 00325 void X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose); 00326 00327 /* 00328 * X509_verify_cert - verify the certificate 00329 */ 00330 int X509_verify_cert(X509_STORE_CTX *v); 00331 00332 00333 /* 00334 * X509_STORE_new - create an X509 store 00335 */ 00336 X509_STORE *X509_STORE_new(void); 00337 00338 00339 /* 00340 * X509_STORE_free - free up an X509 store 00341 */ 00342 void X509_STORE_free(X509_STORE *v); 00343 00344 00345 /* 00346 * X509_free - free up an X509 00347 */ 00348 void X509_free(X509 *v); 00349 00350 00351 /* 00352 * X509_NAME_oneline - return the X509 data in a string 00353 */ 00354 char *X509_NAME_oneline(X509_NAME *a, char *buf, int size); 00355 00356 00357 /* 00358 * X509_get_subject_name - return the X509_NAME for the subject field 00359 */ 00360 X509_NAME *X509_get_subject_name(X509 *a); 00361 00362 00363 /* 00364 * X509_get_issuer_name - return the X509_NAME for the issuer field 00365 */ 00366 X509_NAME *X509_get_issuer_name(X509 *a); 00367 00368 00369 /* 00370 * X509_STORE_add_lookup - add a lookup file/method to an X509 store 00371 */ 00372 X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); 00373 00374 00375 /* 00376 * X509_LOOKUP_file - Definition of the LOOKUP_file method 00377 */ 00378 X509_LOOKUP_METHOD *X509_LOOKUP_file(void); 00379 00380 00381 /* 00382 * X509_LOOKUP_free - Free an X509_LOOKUP 00383 */ 00384 void X509_LOOKUP_free(X509_LOOKUP *x); 00385 00386 00387 /* 00388 * X509_LOOKUP_ctrl - This is not normally called directly (use macros) 00389 */ 00390 int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); 00391 00392 00393 /* 00394 * X509_STORE_CTX_init - initialize an X509 STORE context 00395 */ 00396 void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain); 00397 00398 00399 /* 00400 * CRYPTO_free - free up an internally allocated object 00401 */ 00402 void CRYPTO_free(void *x); 00403 00404 /* 00405 * BIO_new - create new BIO 00406 */ 00407 BIO *BIO_new(BIO_METHOD *type); 00408 00409 /* 00410 * BIO methods - only one defined here yet 00411 */ 00412 BIO_METHOD *BIO_s_mem(void); 00413 00414 /* 00415 * BIO_new_fp - nastiness called BIO - used to create BIO* from FILE* 00416 */ 00417 BIO *BIO_new_fp(FILE *stream, int close_flag); 00418 00419 /* 00420 * BIO_new_mem_buf - read only BIO from memory region 00421 */ 00422 BIO *BIO_new_mem_buf(void *buf, int len); 00423 00424 /* 00425 * BIO_free - nastiness called BIO - used to destroy BIO* 00426 */ 00427 int BIO_free(BIO *a); 00428 00429 /* 00430 * BIO_ctrl - BIO control method 00431 */ 00432 long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); 00433 00434 /* 00435 * BIO_write - equivalent to ::write for BIO 00436 */ 00437 int BIO_write(BIO *b, const void *data, int len); 00438 00439 /* 00440 * PEM_write_bio_X509 - write a PEM encoded cert to a BIO* 00441 */ 00442 int PEM_write_bio_X509(BIO *bp, X509 *x); 00443 00444 00445 /* 00446 * X509_asn1_meth - used for netscape output 00447 */ 00448 ASN1_METHOD *X509_asn1_meth(); 00449 00450 00451 /* 00452 * ASN1_i2d_fp - used for netscape output 00453 */ 00454 int ASN1_i2d_fp(FILE *out, unsigned char *x); 00455 00456 00457 /* 00458 * ASN1_d2i_fp - read an X509 from a DER encoded file (buf can be NULL) 00459 */ 00460 X509 *X509_d2i_fp(FILE *out, X509** buf); 00461 00462 00463 /* 00464 * X509_print - print the text form of an X509 00465 */ 00466 int X509_print(FILE *fp, X509 *x); 00467 00468 00469 /* 00470 * Read a PKCS#12 cert from fp 00471 */ 00472 PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); 00473 00474 00475 /* 00476 * Change the password on a PKCS#12 cert 00477 */ 00478 int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); 00479 00480 00481 /* 00482 * Write a PKCS#12 to mem 00483 */ 00484 int i2d_PKCS12(PKCS12 *p12, unsigned char **p); 00485 00486 00487 /* 00488 * Write a PKCS#12 to FILE* 00489 */ 00490 int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); 00491 00492 00493 /* 00494 * Create a new PKCS#12 object 00495 */ 00496 PKCS12 *PKCS12_new(void); 00497 00498 00499 /* 00500 * Destroy that PKCS#12 that you created! 00501 */ 00502 void PKCS12_free(PKCS12 *a); 00503 00504 00505 /* 00506 * Parse the PKCS#12 00507 */ 00508 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, 00509 X509 **cert, STACK_OF(X509) **ca); 00510 00511 00512 /* 00513 * Free the Private Key 00514 */ 00515 void EVP_PKEY_free(EVP_PKEY *x); 00516 00517 00518 /* 00519 * Pop off the stack 00520 */ 00521 char *sk_pop(STACK *s); 00522 00523 00524 /* 00525 * Free the stack 00526 */ 00527 void sk_free(STACK *s); 00528 00529 00530 /* 00531 * Number of elements in the stack 00532 */ 00533 int sk_num(STACK *s); 00534 00535 00536 /* 00537 * Value of element n in the stack 00538 */ 00539 char *sk_value(STACK *s, int n); 00540 00541 00542 /* 00543 * Create a new stack 00544 */ 00545 STACK *sk_new(int (*cmp)()); 00546 00547 00548 /* 00549 * Add an element to the stack 00550 */ 00551 int sk_push(STACK *s, char *d); 00552 00553 00554 /* 00555 * Duplicate the stack 00556 */ 00557 STACK *sk_dup(STACK *s); 00558 00559 00560 /* 00561 * Convert an ASN1_INTEGER to it's text form 00562 */ 00563 char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); 00564 00565 00566 /* 00567 * Get the certificate's serial number 00568 */ 00569 ASN1_INTEGER *X509_get_serialNumber(X509 *x); 00570 00571 00572 /* 00573 * Get the certificate's public key 00574 */ 00575 EVP_PKEY *X509_get_pubkey(X509 *x); 00576 00577 00578 /* 00579 * Convert the public key to a decimal form 00580 */ 00581 int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); 00582 00583 00584 /* 00585 * Check the private key of a PKCS bundle against the X509 00586 */ 00587 int X509_check_private_key(X509 *x, EVP_PKEY *p); 00588 00589 00590 /* 00591 * Convert a BIGNUM to a hex string 00592 */ 00593 char *BN_bn2hex(const BIGNUM *a); 00594 00595 00596 /* 00597 * Compute the digest of an X.509 00598 */ 00599 int X509_digest(const X509 *x,const EVP_MD *t, unsigned char *md, unsigned int *len); 00600 00601 00602 /* 00603 * EVP_md5 00604 */ 00605 EVP_MD *EVP_md5(); 00606 00607 00608 /* 00609 * ASN1_INTEGER free 00610 */ 00611 void ASN1_INTEGER_free(ASN1_INTEGER *x); 00612 00613 00614 /* 00615 * 00616 */ 00617 int OBJ_obj2nid(ASN1_OBJECT *o); 00618 00619 /* 00620 * 00621 */ 00622 const char * OBJ_nid2ln(int n); 00623 00624 /* 00625 * get the number of extensions 00626 */ 00627 int X509_get_ext_count(X509 *x); 00628 00629 /* 00630 * 00631 */ 00632 int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); 00633 00634 /* 00635 * 00636 */ 00637 int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); 00638 00639 /* 00640 * 00641 */ 00642 X509_EXTENSION *X509_get_ext(X509 *x, int loc); 00643 00644 /* 00645 * 00646 */ 00647 X509_EXTENSION *X509_delete_ext(X509 *x, int loc); 00648 00649 /* 00650 * 00651 */ 00652 int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); 00653 00654 /* 00655 * 00656 */ 00657 void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); 00658 00659 /* 00660 * 00661 */ 00662 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); 00663 00664 /* 00665 * 00666 */ 00667 int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); 00668 00669 /* 00670 * 00671 */ 00672 PKCS7 *PKCS7_new(void); 00673 00674 /* 00675 * 00676 */ 00677 void PKCS7_free(PKCS7 *a); 00678 00679 /* 00680 * 00681 */ 00682 void PKCS7_content_free(PKCS7 *a); 00683 00684 /* 00685 * 00686 */ 00687 int i2d_PKCS7(PKCS7 *a, unsigned char **pp); 00688 00689 /* 00690 * 00691 */ 00692 PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp,long length); 00693 00694 /* 00695 * 00696 */ 00697 int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); 00698 00699 /* 00700 * 00701 */ 00702 PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); 00703 00704 /* 00705 * 00706 */ 00707 int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); 00708 00709 /* 00710 * 00711 */ 00712 PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); 00713 00714 /* 00715 * 00716 */ 00717 PKCS7 *PKCS7_dup(PKCS7 *p7); 00718 00719 /* 00720 * Create a PKCS7 signature / signed message 00721 */ 00722 PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 00723 BIO *data, int flags); 00724 00725 /* 00726 * Verify a PKCS7 signature. 00727 */ 00728 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, 00729 BIO *indata, BIO *out, int flags); 00730 00731 /* 00732 * Get signers of a verified PKCS7 signature 00733 */ 00734 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); 00735 00736 /* 00737 * PKCS7 encrypt message 00738 */ 00739 PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher, 00740 int flags); 00741 00742 /* 00743 * decrypt PKCS7 message 00744 */ 00745 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 00746 00747 00748 /* 00749 * Load a CA list file. 00750 */ 00751 STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); 00752 00753 /* 00754 * Load a file of PEM encoded objects. 00755 */ 00756 STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, 00757 pem_password_cb *cb, void *u); 00758 00759 /* 00760 * Get the number of purposes available 00761 */ 00762 int X509_PURPOSE_get_count(); 00763 00764 00765 /* 00766 * Get the ID of a purpose 00767 */ 00768 int X509_PURPOSE_get_id(X509_PURPOSE *); 00769 00770 00771 /* 00772 * Check the existence of purpose id "id" in x. for CA, set ca = 1, else 0 00773 */ 00774 int X509_check_purpose(X509 *x, int id, int ca); 00775 00776 00777 /* 00778 * Get the purpose with index #idx 00779 */ 00780 X509_PURPOSE * X509_PURPOSE_get0(int idx); 00781 00782 00783 /* 00784 * Create a new Private KEY 00785 */ 00786 EVP_PKEY* EVP_PKEY_new(); 00787 00788 00789 /* 00790 * Assign a private key 00791 */ 00792 int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key); 00793 00794 00795 /* 00796 * Generate a RSA key 00797 */ 00798 RSA *RSA_generate_key(int bits, unsigned long e, void 00799 (*callback)(int,int,void *), void *cb_arg); 00800 00801 00802 /* 00803 * Create/destroy a certificate request 00804 */ 00805 X509_REQ *X509_REQ_new(); 00806 void X509_REQ_free(X509_REQ *a); 00807 00808 00809 /* 00810 * Set the public key in the REQ object 00811 */ 00812 int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); 00813 00814 /* for testing */ 00815 int i2d_X509_REQ_fp(FILE *fp, X509_REQ *x); 00816 00817 /* SMime support */ 00818 STACK *X509_get1_email(X509 *x); 00819 void X509_email_free(STACK *sk); 00820 00821 /* Ciphers needed for SMime */ 00822 EVP_CIPHER *EVP_des_ede3_cbc(); 00823 EVP_CIPHER *EVP_des_cbc(); 00824 EVP_CIPHER *EVP_rc2_cbc(); 00825 EVP_CIPHER *EVP_rc2_64_cbc(); 00826 EVP_CIPHER *EVP_rc2_40_cbc(); 00827 00828 /* clear the current error - use this often*/ 00829 void ERR_clear_error(); 00830 00831 /* retrieve the latest error */ 00832 unsigned long ERR_get_error(); 00833 00834 /* Print the errors to this stream */ 00835 void ERR_print_errors_fp(FILE *fp); 00836 00837 /* Get a pointer to the SSL session id (reference counted) */ 00838 SSL_SESSION *SSL_get1_session(SSL *ssl); 00839 00840 /* Frees a pointer to the SSL session id (reference decremented if needed) */ 00841 void SSL_SESSION_free(SSL_SESSION *session); 00842 00843 /* Set the SSL session to reuse. */ 00844 int SSL_set_session(SSL *ssl, SSL_SESSION *session); 00845 00846 /* Decode ASN.1 to SSL_SESSION */ 00847 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp, long length); 00848 /* Encode SSL_SESSION to ASN.1 */ 00849 int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); 00850 00851 #endif 00852 00853 private: 00854 KOpenSSLProxy(); 00855 ~KOpenSSLProxy(); 00856 KOpenSSLProxyPrivate *d; 00857 00858 KLibrary *_sslLib; 00859 KLibrary *_cryptoLib; 00860 static KOpenSSLProxy *_me; 00861 00862 bool _ok; 00863 }; 00864 00865 #endif 00866
KDE Logo
This file is part of the documentation for kio Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:08:45 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003