38 enum enum_genrsa_mode {
40 LGRSAM_PKCS1_OAEP_PSS,
46 #if defined(LWS_WITH_MBEDTLS)
47 mbedtls_rsa_context *ctx;
49 BIGNUM *bn[LWS_GENCRYPTO_RSA_KEYEL_COUNT];
53 struct lws_context *context;
54 enum enum_genrsa_mode mode;
76 LWS_VISIBLE LWS_EXTERN
int
79 struct lws_context *context,
enum enum_genrsa_mode mode,
80 enum lws_genhash_types oaep_hashid);
93 LWS_VISIBLE LWS_EXTERN
void
114 LWS_VISIBLE LWS_EXTERN
int
132 LWS_VISIBLE LWS_EXTERN
int
134 size_t in_len, uint8_t *out);
149 LWS_VISIBLE LWS_EXTERN
int
151 size_t in_len, uint8_t *out);
167 LWS_VISIBLE LWS_EXTERN
int
169 size_t in_len, uint8_t *out,
size_t out_max);
185 LWS_VISIBLE LWS_EXTERN
int
187 size_t in_len, uint8_t *out,
size_t out_max);
206 LWS_VISIBLE LWS_EXTERN
int
208 enum lws_genhash_types hash_type,
209 const uint8_t *sig,
size_t sig_len);
227 LWS_VISIBLE LWS_EXTERN
int
229 enum lws_genhash_types hash_type,
230 uint8_t *sig,
size_t sig_len);
240 LWS_VISIBLE LWS_EXTERN
void
252 LWS_VISIBLE LWS_EXTERN
int
254 uint8_t *pkey_asn1,
size_t pkey_asn1_len);
LWS_VISIBLE LWS_EXTERN int lws_genrsa_public_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, size_t in_len, uint8_t *out, size_t out_max)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_create(struct lws_genrsa_ctx *ctx, const struct lws_gencrypto_keyelem *el, struct lws_context *context, enum enum_genrsa_mode mode, enum lws_genhash_types oaep_hashid)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx, enum enum_genrsa_mode mode, struct lws_gencrypto_keyelem *el, int bits)
LWS_VISIBLE LWS_EXTERN void lws_genrsa_destroy_elements(struct lws_gencrypto_keyelem *el)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_private_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, size_t in_len, uint8_t *out, size_t out_max)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_render_pkey_asn1(struct lws_genrsa_ctx *ctx, int _private, uint8_t *pkey_asn1, size_t pkey_asn1_len)
LWS_VISIBLE LWS_EXTERN void lws_genrsa_destroy(struct lws_genrsa_ctx *ctx)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_public_encrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, size_t in_len, uint8_t *out)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_private_encrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, size_t in_len, uint8_t *out)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_hash_sig_verify(struct lws_genrsa_ctx *ctx, const uint8_t *in, enum lws_genhash_types hash_type, const uint8_t *sig, size_t sig_len)
LWS_VISIBLE LWS_EXTERN int lws_genrsa_hash_sign(struct lws_genrsa_ctx *ctx, const uint8_t *in, enum lws_genhash_types hash_type, uint8_t *sig, size_t sig_len)
Definition: lws-gencrypto.h:99
Definition: lws-genrsa.h:45