• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.2.0.83
GDCryptoRSA.h
Go to the documentation of this file.
1 /*
2  * (c) 2019 BlackBerry Limited. All rights reserved.
3  */
4 
5 #pragma once
6 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #ifndef GD_C_API
16 # if !defined(_WIN32)
17 # define GD_C_API __attribute__((visibility("default")))
18 # else
19 # define GD_C_API
20 # endif
21 #endif
22 
23 #ifndef GD_C_API_EXT
24 # define GD_C_API_EXT
25 #endif
26 
27 #include "GDCryptoKeyStore.h"
28 #include "GDCryptoAlgorithms.h"
29 #include "GDCryptoError.h"
30 
36 GD_C_API extern const int GDRSA_PKCS1_PADDING;
37 
43 GD_C_API extern const int GDRSA_PKCS1_OAEP_PADDING;
44 
50 GD_C_API extern const int GDRSA_NO_PADDING;
51 
59 struct GD_C_API GDRSA;
60 
69 GD_C_API struct GDRSA* GDRSA_public_key(const struct GDX509* cert);
70 
80 GD_C_API struct GDRSA* GDRSA_private_key(const struct GDX509* cert);
81 
90 GD_C_API int GDRSA_size(const struct GDRSA* rsa);
91 
99 GD_C_API void GDRSA_free(struct GDRSA* rsa);
100 
115 GD_C_API int GDRSA_sign(const struct GDDigest* digest_algorithm, const void* digest, unsigned int digest_size, void* signature, unsigned int* signature_size, struct GDRSA* rsa);
116 
130 GD_C_API int GDRSA_verify(const struct GDDigest* digest_algorithm, const void* digest, unsigned int digest_size, const void* signature, unsigned int signature_size, struct GDRSA* rsa);
131 
145 GD_C_API int GDRSA_public_encrypt(int flen, const void* from, void* to, struct GDRSA* rsa, int padding);
146 
160 GD_C_API int GDRSA_private_decrypt(int flen, const void* from, void* to, struct GDRSA* rsa, int padding);
161 
175 GD_C_API int GDRSA_private_encrypt(int flen, const void* from, void* to, struct GDRSA* rsa, int padding);
176 
190 GD_C_API int GDRSA_public_decrypt(int flen, const void* from, void* to, struct GDRSA* rsa, int padding);
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
GDRSA_PKCS1_OAEP_PADDING
const int GDRSA_PKCS1_OAEP_PADDING
PKCS #1 OAEP padding.
GDRSA_free
void GDRSA_free(struct GDRSA *rsa)
Free a RSA key structure.
GDRSA_sign
int GDRSA_sign(const struct GDDigest *digest_algorithm, const void *digest, unsigned int digest_size, void *signature, unsigned int *signature_size, struct GDRSA *rsa)
RSA sign a message digest.
GDRSA_public_decrypt
int GDRSA_public_decrypt(int flen, const void *from, void *to, struct GDRSA *rsa, int padding)
RSA public decrypt.
GDCryptoKeyStore.h
GDRSA_NO_PADDING
const int GDRSA_NO_PADDING
No padding.
GDRSA_public_encrypt
int GDRSA_public_encrypt(int flen, const void *from, void *to, struct GDRSA *rsa, int padding)
RSA public encrypt.
GDRSA_public_key
struct GDRSA * GDRSA_public_key(const struct GDX509 *cert)
Retrieve the RSA public key.
GDRSA_verify
int GDRSA_verify(const struct GDDigest *digest_algorithm, const void *digest, unsigned int digest_size, const void *signature, unsigned int signature_size, struct GDRSA *rsa)
Verify an RSA signed message.
GDRSA_size
int GDRSA_size(const struct GDRSA *rsa)
RSA modulus size.
GDDigest
int GDDigest(const void *data, size_t data_sz, void *md, unsigned int *md_sz, const struct GDDigest *type)
Calculate a digest.
GDCryptoAlgorithms.h
GDRSA_private_decrypt
int GDRSA_private_decrypt(int flen, const void *from, void *to, struct GDRSA *rsa, int padding)
RSA private decrypt.
GDRSA_PKCS1_PADDING
const int GDRSA_PKCS1_PADDING
PKCS #1 padding.
GDRSA_private_encrypt
int GDRSA_private_encrypt(int flen, const void *from, void *to, struct GDRSA *rsa, int padding)
RSA private encrypt.
GDCryptoError.h
GDRSA_private_key
struct GDRSA * GDRSA_private_key(const struct GDX509 *cert)
Retrieve a pseudo private RSA key corresponding to a user certificate.