A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.

Dependents:   HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL

Committer:
Mike Fiore
Date:
Mon Mar 23 16:51:07 2015 -0500
Revision:
6:cf58d49e1a86
Parent:
0:b86d15c6ba29
fix whitespace in sha512.c

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vanger 0:b86d15c6ba29 1 /* rsa.h for openSSL */
Vanger 0:b86d15c6ba29 2
Vanger 0:b86d15c6ba29 3
Vanger 0:b86d15c6ba29 4 #ifndef CYASSL_RSA_H_
Vanger 0:b86d15c6ba29 5 #define CYASSL_RSA_H_
Vanger 0:b86d15c6ba29 6
Vanger 0:b86d15c6ba29 7 #include <cyassl/openssl/ssl.h>
Vanger 0:b86d15c6ba29 8 #include <cyassl/openssl/bn.h>
Vanger 0:b86d15c6ba29 9
Vanger 0:b86d15c6ba29 10
Vanger 0:b86d15c6ba29 11 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 12 extern "C" {
Vanger 0:b86d15c6ba29 13 #endif
Vanger 0:b86d15c6ba29 14
Vanger 0:b86d15c6ba29 15
Vanger 0:b86d15c6ba29 16 enum {
Vanger 0:b86d15c6ba29 17 RSA_PKCS1_PADDING = 1
Vanger 0:b86d15c6ba29 18 };
Vanger 0:b86d15c6ba29 19
Vanger 0:b86d15c6ba29 20 struct CYASSL_RSA {
Vanger 0:b86d15c6ba29 21 CYASSL_BIGNUM* n;
Vanger 0:b86d15c6ba29 22 CYASSL_BIGNUM* e;
Vanger 0:b86d15c6ba29 23 CYASSL_BIGNUM* d;
Vanger 0:b86d15c6ba29 24 CYASSL_BIGNUM* p;
Vanger 0:b86d15c6ba29 25 CYASSL_BIGNUM* q;
Vanger 0:b86d15c6ba29 26 CYASSL_BIGNUM* dmp1; /* dP */
Vanger 0:b86d15c6ba29 27 CYASSL_BIGNUM* dmq1; /* dQ */
Vanger 0:b86d15c6ba29 28 CYASSL_BIGNUM* iqmp; /* u */
Vanger 0:b86d15c6ba29 29 void* internal; /* our RSA */
Vanger 0:b86d15c6ba29 30 char inSet; /* internal set from external ? */
Vanger 0:b86d15c6ba29 31 char exSet; /* external set from internal ? */
Vanger 0:b86d15c6ba29 32 };
Vanger 0:b86d15c6ba29 33
Vanger 0:b86d15c6ba29 34
Vanger 0:b86d15c6ba29 35 CYASSL_API CYASSL_RSA* CyaSSL_RSA_new(void);
Vanger 0:b86d15c6ba29 36 CYASSL_API void CyaSSL_RSA_free(CYASSL_RSA*);
Vanger 0:b86d15c6ba29 37
Vanger 0:b86d15c6ba29 38 CYASSL_API int CyaSSL_RSA_generate_key_ex(CYASSL_RSA*, int bits, CYASSL_BIGNUM*,
Vanger 0:b86d15c6ba29 39 void* cb);
Vanger 0:b86d15c6ba29 40
Vanger 0:b86d15c6ba29 41 CYASSL_API int CyaSSL_RSA_blinding_on(CYASSL_RSA*, CYASSL_BN_CTX*);
Vanger 0:b86d15c6ba29 42 CYASSL_API int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr,
Vanger 0:b86d15c6ba29 43 unsigned char* to, CYASSL_RSA*, int padding);
Vanger 0:b86d15c6ba29 44 CYASSL_API int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr,
Vanger 0:b86d15c6ba29 45 unsigned char* to, CYASSL_RSA*, int padding);
Vanger 0:b86d15c6ba29 46
Vanger 0:b86d15c6ba29 47 CYASSL_API int CyaSSL_RSA_size(const CYASSL_RSA*);
Vanger 0:b86d15c6ba29 48 CYASSL_API int CyaSSL_RSA_sign(int type, const unsigned char* m,
Vanger 0:b86d15c6ba29 49 unsigned int mLen, unsigned char* sigRet,
Vanger 0:b86d15c6ba29 50 unsigned int* sigLen, CYASSL_RSA*);
Vanger 0:b86d15c6ba29 51 CYASSL_API int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from,
Vanger 0:b86d15c6ba29 52 unsigned char* to, CYASSL_RSA*, int padding);
Vanger 0:b86d15c6ba29 53 CYASSL_API int CyaSSL_RSA_GenAdd(CYASSL_RSA*);
Vanger 0:b86d15c6ba29 54 CYASSL_API int CyaSSL_RSA_LoadDer(CYASSL_RSA*, const unsigned char*, int sz);
Vanger 0:b86d15c6ba29 55
Vanger 0:b86d15c6ba29 56
Vanger 0:b86d15c6ba29 57 #define RSA_new CyaSSL_RSA_new
Vanger 0:b86d15c6ba29 58 #define RSA_free CyaSSL_RSA_free
Vanger 0:b86d15c6ba29 59
Vanger 0:b86d15c6ba29 60 #define RSA_generate_key_ex CyaSSL_RSA_generate_key_ex
Vanger 0:b86d15c6ba29 61
Vanger 0:b86d15c6ba29 62 #define RSA_blinding_on CyaSSL_RSA_blinding_on
Vanger 0:b86d15c6ba29 63 #define RSA_public_encrypt CyaSSL_RSA_public_encrypt
Vanger 0:b86d15c6ba29 64 #define RSA_private_decrypt CyaSSL_RSA_private_decrypt
Vanger 0:b86d15c6ba29 65
Vanger 0:b86d15c6ba29 66 #define RSA_size CyaSSL_RSA_size
Vanger 0:b86d15c6ba29 67 #define RSA_sign CyaSSL_RSA_sign
Vanger 0:b86d15c6ba29 68 #define RSA_public_decrypt CyaSSL_RSA_public_decrypt
Vanger 0:b86d15c6ba29 69
Vanger 0:b86d15c6ba29 70
Vanger 0:b86d15c6ba29 71 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 72 } /* extern "C" */
Vanger 0:b86d15c6ba29 73 #endif
Vanger 0:b86d15c6ba29 74
Vanger 0:b86d15c6ba29 75 #endif /* header */