• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kssl
kopenssl.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2001-2003 George Staikos <staikos@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19
20// IF YOU ARE USING THIS CLASS, YOU ARE MAKING A MISTAKE.
21
22#ifndef __KOPENSSLPROXY_H
23#define __KOPENSSLPROXY_H
24
25#define KOSSL KOpenSSLProxy
26class KOpenSSLProxyPrivate;
27
28#include <kio/kio_export.h>
29
30#include <ksslconfig.h>
31
32#ifdef KSSL_HAVE_SSL
33#define crypt _openssl_crypt
34#include <openssl/ssl.h>
35#include <openssl/x509.h>
36#include <openssl/x509v3.h>
37#include <openssl/pem.h>
38#include <openssl/bio.h>
39#include <openssl/rand.h>
40#include <openssl/asn1.h>
41#include <openssl/pkcs7.h>
42#include <openssl/pkcs12.h>
43#include <openssl/evp.h>
44#include <openssl/stack.h>
45#include <openssl/bn.h>
46#undef crypt
47#if OPENSSL_VERSION_NUMBER >= 0x10000000L
48#define STACK _STACK
49#define OSSL_SKVALUE_RTYPE void
50#define OSSL_MORECONST const
51#else
52#define OSSL_SKVALUE_RTYPE char
53#define OSSL_MORECONST
54#endif
55#endif
56
65class KOpenSSLProxy {
66public:
67
72 static KOpenSSLProxy *self();
73
77 bool hasLibCrypto() const;
78
82 bool hasLibSSL() const;
83
88 void destroy();
89
90 // Here are the symbols that we need.
91#ifdef KSSL_HAVE_SSL
92
93 /*
94 * SSL_connect - initiate the TLS/SSL handshake with an TLS/SSL server
95 */
96 int SSL_connect(SSL *ssl);
97
98 /*
99 * SSL_accept - initiate the TLS/SSL handshake with an TLS/SSL server
100 */
101 int SSL_accept(SSL *ssl);
102
103 /*
104 * SSL_get_error - get the error code
105 */
106 int SSL_get_error(SSL *ssl, int rc);
107
108 /*
109 * SSL_read - read bytes from a TLS/SSL connection.
110 */
111 int SSL_read(SSL *ssl, void *buf, int num);
112
113 /*
114 * SSL_write - write bytes to a TLS/SSL connection.
115 */
116 int SSL_write(SSL *ssl, const void *buf, int num);
117
118 /*
119 * SSL_new - create a new SSL structure for a connection
120 */
121 SSL *SSL_new(SSL_CTX *ctx);
122
123 /*
124 * SSL_free - free an allocated SSL structure
125 */
126 void SSL_free(SSL *ssl);
127
128 /*
129 * SSL_shutdown - shutdown an allocated SSL connection
130 */
131 int SSL_shutdown(SSL *ssl);
132
133 /*
134 * SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions
135 */
136 SSL_CTX *SSL_CTX_new(SSL_METHOD *method);
137
138 /*
139 * SSL_CTX_free - free an allocated SSL_CTX object
140 */
141 void SSL_CTX_free(SSL_CTX *ctx);
142
143 /*
144 * SSL_set_fd - connect the SSL object with a file descriptor
145 */
146 int SSL_set_fd(SSL *ssl, int fd);
147
148 /*
149 * SSL_pending - obtain number of readable bytes buffered in an SSL object
150 */
151 int SSL_pending(SSL *ssl);
152
153 /*
154 * SSL_peek - obtain bytes buffered in an SSL object
155 */
156 int SSL_peek(SSL *ssl, void *buf, int num);
157
158 /*
159 * SSL_CTX_set_cipher_list - choose list of available SSL_CIPHERs
160 */
161 int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str);
162
163 /*
164 * SSL_CTX_set_verify - set peer certificate verification parameters
165 */
166 void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,
167 int (*verify_callback)(int, X509_STORE_CTX *));
168
169 /*
170 * SSL_use_certificate - load certificate
171 */
172 int SSL_use_certificate(SSL *ssl, X509 *x);
173
174 /*
175 * SSL_get_current_cipher - get SSL_CIPHER of a connection
176 */
177 SSL_CIPHER *SSL_get_current_cipher(SSL *ssl);
178
179 /*
180 * SSL_set_options - manipulate SSL engine options
181 * Note: These are all mapped to SSL_ctrl so call them as the comment
182 * specifies but know that they use SSL_ctrl. They are #define
183 * so they will map to the one in this class if called as a
184 * member function of this class.
185 */
186 /* long SSL_set_options(SSL *ssl, long options); */
187 /* Returns 0 if not reused, 1 if session id is reused */
188 /* int SSL_session_reused(SSL *ssl); */
189 long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg);
190
191 /*
192 * RAND_egd - set the path to the EGD
193 */
194 int RAND_egd(const char *path);
195
196
197 /*
198 * RAND_file_name
199 */
200 const char *RAND_file_name(char *buf, size_t num);
201
202
203 /*
204 * RAND_load_file
205 */
206 int RAND_load_file(const char *filename, long max_bytes);
207
208
209 /*
210 * RAND_write_file
211 */
212 int RAND_write_file(const char *filename);
213
214
215 /*
216 * TLSv1_client_method - return a TLSv1 client method object
217 */
218 SSL_METHOD *TLSv1_client_method();
219
220
221 /*
222 * SSLv23_client_method - return a SSLv23 client method object
223 */
224 SSL_METHOD *SSLv23_client_method();
225
226
227 /*
228 * SSL_get_peer_certificate - return the peer's certificate
229 */
230 X509 *SSL_get_peer_certificate(SSL *s);
231
232
233 /*
234 * SSL_get_peer_cert_chain - get the peer's certificate chain
235 */
236 STACK_OF(X509) *SSL_get_peer_cert_chain(SSL *s);
237
238 /*
239 * SSL_CIPHER_get_bits - get the number of bits in this cipher
240 */
241 int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits);
242
243
244 /*
245 * SSL_CIPHER_get_version - get the version of this cipher
246 */
247 char *SSL_CIPHER_get_version(SSL_CIPHER *c);
248
249
250 /*
251 * SSL_CIPHER_get_name - get the name of this cipher
252 */
253 const char *SSL_CIPHER_get_name(SSL_CIPHER *c);
254
255
256 /*
257 * SSL_CIPHER_description - get the description of this cipher
258 */
259 char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size);
260
261
262 /*
263 * SSL_CTX_use_PrivateKey - set the private key for the session.
264 * - for use with client certificates
265 */
266 int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
267
268
269 /*
270 * SSL_CTX_use_certificate - set the client certificate for the session.
271 */
272 int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
273
274
275 /*
276 * d2i_X509 - Convert a text representation of X509 to an X509 object
277 */
278 X509 * d2i_X509(X509 **a,unsigned char **pp,long length);
279
280
281 /*
282 * i2d_X509 - Convert an X509 object into a text representation
283 */
284 int i2d_X509(X509 *a,unsigned char **pp);
285
286
287 /*
288 * X509_cmp - compare two X509 objects
289 */
290 int X509_cmp(X509 *a, X509 *b);
291
292
293 /*
294 * X509_dup - duplicate an X509 object
295 */
296 X509 *X509_dup(X509 *x509);
297
298
299 /*
300 * X509_getm_notBefore - get validity start
301 */
302 ASN1_TIME *X509_getm_notBefore(const X509 *x);
303
304
305 /*
306 * X509_getm_notAfter - get validity end
307 */
308 ASN1_TIME *X509_getm_notAfter(const X509 *x);
309
310
311 /*
312 * X509_STORE_CTX_new - create an X509 store context
313 */
314 X509_STORE_CTX *X509_STORE_CTX_new(void);
315
316
317 /*
318 * X509_STORE_CTX_free - free up an X509 store context
319 */
320 void X509_STORE_CTX_free(X509_STORE_CTX *v);
321
322
323 /*
324 * X509_STORE_CTX_set_chain - set the certificate chain
325 */
326 void X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x);
327
328
329 /*
330 * X509_STORE_CTX_set_purpose - set the purpose of the certificate
331 */
332 void X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose);
333
334
335 /*
336 * X509_STORE_CTX_get_current_cert - get the current certificate
337 */
338 X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *v);
339
340
341 /*
342 * X509_STORE_CTX_set_error - set certificate error
343 */
344 void X509_STORE_CTX_set_error(X509_STORE_CTX *v, int error);
345
346
347 /*
348 * X509_STORE_CTX_get_error - get certificate error
349 */
350 int X509_STORE_CTX_get_error(X509_STORE_CTX *v);
351
352
353 /*
354 * X509_verify_cert - verify the certificate
355 */
356 int X509_verify_cert(X509_STORE_CTX *v);
357
358
359 /*
360 * X509_STORE_new - create an X509 store
361 */
362 X509_STORE *X509_STORE_new(void);
363
364
365 /*
366 * X509_STORE_free - free up an X509 store
367 */
368 void X509_STORE_free(X509_STORE *v);
369
370
371 /*
372 * X509_STORE_set_verify_cb - set verify callback
373 */
374 void X509_STORE_set_verify_cb(X509_STORE *v, int (*verify_cb)(int, X509_STORE_CTX *));
375
376
377 /*
378 * X509_free - free up an X509
379 */
380 void X509_free(X509 *v);
381
382
383 /*
384 * X509_NAME_oneline - return the X509 data in a string
385 */
386 char *X509_NAME_oneline(X509_NAME *a, char *buf, int size);
387
388
389 /*
390 * X509_get_subject_name - return the X509_NAME for the subject field
391 */
392 X509_NAME *X509_get_subject_name(X509 *a);
393
394
395 /*
396 * X509_get_issuer_name - return the X509_NAME for the issuer field
397 */
398 X509_NAME *X509_get_issuer_name(X509 *a);
399
400
401 /*
402 * X509_get0_signature - return X509 signature and signature algorithm
403 */
404 void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x);
405
406
407 /*
408 * X509_STORE_add_lookup - add a lookup file/method to an X509 store
409 */
410 X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
411
412
413 /*
414 * X509_LOOKUP_file - Definition of the LOOKUP_file method
415 */
416 X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
417
418
419 /*
420 * X509_LOOKUP_free - Free an X509_LOOKUP
421 */
422 void X509_LOOKUP_free(X509_LOOKUP *x);
423
424
425 /*
426 * X509_LOOKUP_ctrl - This is not normally called directly (use macros)
427 */
428 int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret);
429
430
431 /*
432 * X509_STORE_CTX_init - initialize an X509 STORE context
433 */
434 void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain);
435
436
437 /*
438 * CRYPTO_free - free up an internally allocated object
439 */
440#if OPENSSL_VERSION_NUMBER < 0x10100000L
441 void CRYPTO_free(void *x);
442#else
443 void CRYPTO_free(void *x, const char *file, int line);
444#endif
445
446 /*
447 * BIO_new - create new BIO
448 */
449 BIO *BIO_new(BIO_METHOD *type);
450
451 /*
452 * BIO methods - only one defined here yet
453 */
454 BIO_METHOD *BIO_s_mem(void);
455
456 /*
457 * BIO_new_fp - nastiness called BIO - used to create BIO* from FILE*
458 */
459 BIO *BIO_new_fp(FILE *stream, int close_flag);
460
461 /*
462 * BIO_new_mem_buf - read only BIO from memory region
463 */
464 BIO *BIO_new_mem_buf(void *buf, int len);
465
466 /*
467 * BIO_free - nastiness called BIO - used to destroy BIO*
468 */
469 int BIO_free(BIO *a);
470
471 /*
472 * BIO_ctrl - BIO control method
473 */
474 long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
475
476 /*
477 * BIO_write - equivalent to ::write for BIO
478 */
479 int BIO_write(BIO *b, const void *data, int len);
480
481 /*
482 * PEM_write_bio_X509 - write a PEM encoded cert to a BIO*
483 */
484 int PEM_write_bio_X509(BIO *bp, X509 *x);
485
486 /*
487 * ASN1_item_i2d_fp - used for netscape output
488 */
489 int ASN1_item_i2d_fp(FILE *out, unsigned char *x);
490
491
492 /*
493 * ASN1_d2i_fp - read an X509 from a DER encoded file (buf can be NULL)
494 */
495 X509 *X509_d2i_fp(FILE *out, X509** buf);
496
497
498 /*
499 * X509_print - print the text form of an X509
500 */
501 int X509_print(FILE *fp, X509 *x);
502
503
504 /*
505 * Read a PKCS#12 cert from fp
506 */
507 PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
508
509
510 /*
511 * Change the password on a PKCS#12 cert
512 */
513 int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
514
515
516 /*
517 * Write a PKCS#12 to mem
518 */
519 int i2d_PKCS12(PKCS12 *p12, unsigned char **p);
520
521
522 /*
523 * Write a PKCS#12 to FILE*
524 */
525 int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
526
527
528 /*
529 * Create a new PKCS#12 object
530 */
531 PKCS12 *PKCS12_new(void);
532
533
534 /*
535 * Destroy that PKCS#12 that you created!
536 */
537 void PKCS12_free(PKCS12 *a);
538
539
540 /*
541 * Parse the PKCS#12
542 */
543 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey,
544 X509 **cert, STACK_OF(X509) **ca);
545
546
547 /*
548 * Free the Private Key
549 */
550 void EVP_PKEY_free(EVP_PKEY *x);
551
552
553 /*
554 * Pop off the stack
555 */
556 char *OPENSSL_sk_pop(STACK *s);
557
558
559 /*
560 * Free the stack
561 */
562 void OPENSSL_sk_free(STACK *s);
563
564#if OPENSSL_VERSION_NUMBER >= 0x10000000L
565 void OPENSSL_sk_free(void *s) { return OPENSSL_sk_free(reinterpret_cast<STACK*>(s)); }
566#endif
567
568 /*
569 * Number of elements in the stack
570 */
571 int OPENSSL_sk_num(STACK *s);
572
573
574 /*
575 * Value of element n in the stack
576 */
577 char *OPENSSL_sk_value(STACK *s, int n);
578
579#if OPENSSL_VERSION_NUMBER >= 0x10000000L
580 char *OPENSSL_sk_value(void *s, int n) { return OPENSSL_sk_value(reinterpret_cast<STACK*>(s), n); }
581#endif
582
583 /*
584 * Create a new stack
585 */
586 STACK *OPENSSL_sk_new(int (*cmp)());
587
588
589 /*
590 * Add an element to the stack
591 */
592 int OPENSSL_sk_push(STACK *s, char *d);
593
594#if OPENSSL_VERSION_NUMBER >= 0x10000000L
595 int OPENSSL_sk_push(void *s, void *d) { return OPENSSL_sk_push(reinterpret_cast<STACK*>(s), reinterpret_cast<char*>(d)); }
596#endif
597
598
599 /*
600 * Duplicate the stack
601 */
602 STACK *OPENSSL_sk_dup(STACK *s);
603
604
605 /*
606 * Convert an ASN1_INTEGER to its text form
607 */
608 char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
609
610
611 /*
612 * Get the certificate's serial number
613 */
614 ASN1_INTEGER *X509_get_serialNumber(X509 *x);
615
616
617 /*
618 * Get the certificate's public key
619 */
620 EVP_PKEY *X509_get_pubkey(X509 *x);
621
622
623 /*
624 * Convert the public key to a decimal form
625 */
626 int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
627
628
629 /*
630 * Check the private key of a PKCS bundle against the X509
631 */
632 int X509_check_private_key(X509 *x, EVP_PKEY *p);
633
634
635 /*
636 * Convert a BIGNUM to a hex string
637 */
638 char *BN_bn2hex(const BIGNUM *a);
639
640
641 /*
642 * Compute the digest of an X.509
643 */
644 int X509_digest(const X509 *x,const EVP_MD *t, unsigned char *md, unsigned int *len);
645
646
647 /*
648 * EVP_md5
649 */
650 EVP_MD *EVP_md5();
651
652
653 /*
654 * ASN1_INTEGER free
655 */
656 void ASN1_INTEGER_free(ASN1_INTEGER *x);
657
658
659 /*
660 * ASN1_STRING_data
661 */
662 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
663
664 /*
665 * ASN1_STRING_length
666 */
667 int ASN1_STRING_length(ASN1_STRING *x);
668
669 /*
670 *
671 */
672 int OBJ_obj2nid(ASN1_OBJECT *o);
673
674 /*
675 *
676 */
677 const char * OBJ_nid2ln(int n);
678
679 /*
680 * get the number of extensions
681 */
682 int X509_get_ext_count(X509 *x);
683
684 /*
685 *
686 */
687 int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
688
689 /*
690 *
691 */
692 int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos);
693
694 /*
695 *
696 */
697 X509_EXTENSION *X509_get_ext(X509 *x, int loc);
698
699 /*
700 *
701 */
702 X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
703
704 /*
705 *
706 */
707 int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
708
709 /*
710 *
711 */
712 void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
713
714 /*
715 *
716 */
717 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
718
719 /*
720 *
721 */
722 int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
723
724 /*
725 *
726 */
727 PKCS7 *PKCS7_new(void);
728
729 /*
730 *
731 */
732 void PKCS7_free(PKCS7 *a);
733
734 /*
735 *
736 */
737 void PKCS7_content_free(PKCS7 *a);
738
739 /*
740 *
741 */
742 int i2d_PKCS7(PKCS7 *a, unsigned char **pp);
743
744 /*
745 *
746 */
747 PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp,long length);
748
749 /*
750 *
751 */
752 int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7);
753
754 /*
755 *
756 */
757 PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7);
758
759 /*
760 *
761 */
762 int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7);
763
764 /*
765 *
766 */
767 PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7);
768
769 /*
770 *
771 */
772 PKCS7 *PKCS7_dup(PKCS7 *p7);
773
774 /*
775 * Create a PKCS7 signature / signed message
776 */
777 PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
778 BIO *data, int flags);
779
780 /*
781 * Verify a PKCS7 signature.
782 */
783 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
784 BIO *indata, BIO *out, int flags);
785
786 /*
787 * Get signers of a verified PKCS7 signature
788 */
789 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
790
791 /*
792 * PKCS7 encrypt message
793 */
794 PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
795 int flags);
796
797 /*
798 * decrypt PKCS7 message
799 */
800 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
801
802
803 /*
804 * Load a CA list file.
805 */
806 STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
807
808 /*
809 * Load a file of PEM encoded objects.
810 */
811 STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
812 pem_password_cb *cb, void *u);
813
814 /*
815 * Get the number of purposes available
816 */
817 int X509_PURPOSE_get_count();
818
819
820 /*
821 * Get the ID of a purpose
822 */
823 int X509_PURPOSE_get_id(X509_PURPOSE *);
824
825
826 /*
827 * Check the existence of purpose id "id" in x. for CA, set ca = 1, else 0
828 */
829 int X509_check_purpose(X509 *x, int id, int ca);
830
831
832 /*
833 * Get the purpose with index #idx
834 */
835 X509_PURPOSE * X509_PURPOSE_get0(int idx);
836
837
838 /*
839 * Create a new Private KEY
840 */
841 EVP_PKEY* EVP_PKEY_new();
842
843
844 /*
845 * Assign a private key
846 */
847 int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key);
848
849
850 /*
851 * Get key type
852 */
853 int EVP_PKEY_base_id(EVP_PKEY *pkey);
854
855 RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey);
856 void RSA_get0_key(RSA *rsa, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
857 DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey);
858 void DSA_get0_pqg(DSA *dsa, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
859 void DSA_get0_key(DSA *dsa, const BIGNUM **pub_key, const BIGNUM **priv_key);
860
861
862 /*
863 * Generate a RSA key
864 */
865 RSA *RSA_generate_key(int bits, unsigned long e, void
866 (*callback)(int,int,void *), void *cb_arg);
867
868
869 /*
870 * Create/destroy a certificate request
871 */
872 X509_REQ *X509_REQ_new();
873 void X509_REQ_free(X509_REQ *a);
874
875
876 /*
877 * Set the public key in the REQ object
878 */
879 int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
880
881 /* for testing */
882 int i2d_X509_REQ_fp(FILE *fp, X509_REQ *x);
883
884 /* SMime support */
885 STACK *X509_get1_email(X509 *x);
886 void X509_email_free(STACK *sk);
887
888 /* Ciphers needed for SMime */
889 EVP_CIPHER *EVP_des_ede3_cbc();
890 EVP_CIPHER *EVP_des_cbc();
891 EVP_CIPHER *EVP_rc2_cbc();
892 EVP_CIPHER *EVP_rc2_64_cbc();
893 EVP_CIPHER *EVP_rc2_40_cbc();
894
895 /* clear the current error - use this often*/
896 void ERR_clear_error();
897
898 /* retrieve the latest error */
899 unsigned long ERR_get_error();
900
901 /* Print the errors to this stream */
902 void ERR_print_errors_fp(FILE *fp);
903
904 /* Get a pointer to the SSL session id (reference counted) */
905 SSL_SESSION *SSL_get1_session(SSL *ssl);
906
907 /* Frees a pointer to the SSL session id (reference decremented if needed) */
908 void SSL_SESSION_free(SSL_SESSION *session);
909
910 /* Set the SSL session to reuse. */
911 int SSL_set_session(SSL *ssl, SSL_SESSION *session);
912
913 /* Decode ASN.1 to SSL_SESSION */
914 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp, long length);
915 /* Encode SSL_SESSION to ASN.1 */
916 int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
917
918 /* Write privatekey to FILE stream */
919 int i2d_PrivateKey_fp(FILE*, EVP_PKEY*);
920
921 /* Write PKCS#8privatekey to FILE stream */
922 int i2d_PKCS8PrivateKey_fp(FILE*, EVP_PKEY*, const EVP_CIPHER*, char*, int, pem_password_cb*, void*);
923
924 /* Free RSA structure */
925 void RSA_free(RSA*);
926
927 /* Get a blowfish CBC pointer */
928 EVP_CIPHER *EVP_bf_cbc();
929
930 /* Sign a CSR */
931 int X509_REQ_sign(X509_REQ*, EVP_PKEY*, const EVP_MD*);
932
933 /* add a name entry */
934 int X509_NAME_add_entry_by_txt(X509_NAME*, char*, int, unsigned char*, int, int, int);
935
936 /* Create a name */
937 X509_NAME *X509_NAME_new();
938
939 /* Set the subject */
940 int X509_REQ_set_subject_name(X509_REQ*,X509_NAME*);
941
942 /* get list of available SSL_CIPHER's sorted by preference */
943 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL* ssl);
944
945#endif
946
947private:
948 friend class KOpenSSLProxyPrivate;
949 KOpenSSLProxy();
950 ~KOpenSSLProxy();
951 KOpenSSLProxyPrivate * const d;
952};
953
954#endif
KOpenSSLProxy
Dynamically load and wrap OpenSSL.
Definition: kopenssl.h:65
KOpenSSLProxy::destroy
void destroy()
Destroy the class and start over - don't use this unless you know what you are doing.
Definition: kopenssl.cpp:251
KOpenSSLProxy::hasLibSSL
bool hasLibSSL() const
Return true of libssl was found and loaded.
Definition: kopenssl.cpp:241
KOpenSSLProxy::hasLibCrypto
bool hasLibCrypto() const
Return true of libcrypto was found and loaded.
Definition: kopenssl.cpp:246
KOpenSSLProxy::self
static KOpenSSLProxy * self()
Return an instance of class KOpenSSLProxy * You cannot delete this object.
Definition: kopenssl.cpp:722
KOpenSSLProxy::KOpenSSLProxyPrivate
friend class KOpenSSLProxyPrivate
Definition: kopenssl.h:948
fp
static const char fp[]
Definition: des.cpp:68
kio_export.h
BIO_ctrl
#define BIO_ctrl
Definition: ksmimecrypto.cpp:46
STACK_OF
#define STACK_OF(x)
Definition: ksslpkcs12.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal