• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.2.0.83
GDCryptoPKCS7.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 "GDStream.h"
28 #include "GDCryptoKeyStore.h"
29 #include "GDCryptoAlgorithms.h"
30 #include "GDCryptoError.h"
31 
35 struct GD_C_API GDPKCS7;
36 
42 GD_C_API extern const int GDPKCS7_TEXT;
43 GD_C_API extern const int GDPKCS7_NOCERTS;
44 GD_C_API extern const int GDPKCS7_NOSIGS;
45 GD_C_API extern const int GDPKCS7_NOCHAIN;
46 GD_C_API extern const int GDPKCS7_NOINTERN;
47 GD_C_API extern const int GDPKCS7_NOVERIFY;
48 GD_C_API extern const int GDPKCS7_DETACHED;
49 GD_C_API extern const int GDPKCS7_BINARY;
50 GD_C_API extern const int GDPKCS7_NOATTR;
51 GD_C_API extern const int GDPKCS7_NOSMIMECAP;
52 GD_C_API extern const int GDPKCS7_NOOLDMIMETYPE;
53 GD_C_API extern const int GDPKCS7_CRLFEOL;
54 GD_C_API extern const int GDPKCS7_STREAM;
55 GD_C_API extern const int GDPKCS7_NOCRL;
56 GD_C_API extern const int GDPKCS7_PARTIAL;
57 GD_C_API extern const int GDPKCS7_REUSE_DIGEST;
58 GD_C_API extern const int GDPKCS7_USE_KEYID;
59 GD_C_API extern const int GDPKCS7_KEY_PARAM;
60 
64 GD_C_API extern const int GDPKCS7_SIGNED;
65 
69 GD_C_API extern const int GDPKCS7_ENCRYPTED;
70 
74 GD_C_API extern const int GDPKCS7_ENVELOPED;
75 
79 GD_C_API extern const int GDPKCS7_SIGNED_AND_ENVELOPED;
80 
84 GD_C_API extern const int GDPKCS7_DATA;
85 
89 GD_C_API extern const int GDPKCS7_DIGEST;
90 
100 GD_C_API struct GDPKCS7* GDPKCS7_SMIME_read(struct GDStream* stream, struct GDStream** clearText, int flags);
101 
109 GD_C_API struct GDPKCS7* GDPKCS7_read(struct GDStream* stream, int flags);
110 
119 GD_C_API int GDPKCS7_type(struct GDPKCS7 *p7, int flags);
120 
132 GD_C_API int GDPKCS7_verify(struct GDPKCS7 *p7, const struct GDX509List* certs, const struct GDX509List* anchors, struct GDStream* indata, struct GDStream* out, int flags);
133 
140 GD_C_API const struct GDX509List* GDPKCS7_get_signers(struct GDPKCS7* p7, int flags);
141 
152 GD_C_API int GDPKCS7_decrypt(struct GDPKCS7* p7, struct GDKey* pkey, const struct GDX509* cert, struct GDStream* data, int flags);
153 
163 GD_C_API struct GDPKCS7* GDPKCS7_encrypt(struct GDX509List* certs, struct GDStream* in, const struct GDCipher* cipher, int flags);
164 
175 GD_C_API struct GDPKCS7* GDPKCS7_add_signer(const struct GDX509* signcert, struct GDKey* pkey, struct GDX509List* certs, const struct GDDigest* md, int flags);
176 
185 GD_C_API int GDPKCS7_final(struct GDPKCS7* p7, struct GDStream* data, int flags);
186 
196 GD_C_API int GDPKCS7_write(struct GDStream* stream, struct GDPKCS7* p7, int flags);
197 
208 GD_C_API int GDPKCS7_SMIME_write(struct GDStream* stream, struct GDPKCS7* p7, struct GDStream* data, int flags);
209 
216 GD_C_API void GDPKCS7_free(struct GDPKCS7* p7, int flags);
217 
218 #ifdef __cplusplus
219 }
220 #endif
221 
GDPKCS7_SMIME_read
struct GDPKCS7 * GDPKCS7_SMIME_read(struct GDStream *stream, struct GDStream **clearText, int flags)
Deserialize SMIME to a PKCS7 structure.
GDPKCS7_KEY_PARAM
const int GDPKCS7_KEY_PARAM
GDPKCS7_SIGNED_AND_ENVELOPED
const int GDPKCS7_SIGNED_AND_ENVELOPED
PKCS7 content-type:pkcs7-signedAndEnvelopedData.
GDPKCS7_BINARY
const int GDPKCS7_BINARY
GDPKCS7_free
void GDPKCS7_free(struct GDPKCS7 *p7, int flags)
Free a PKCS7 structure.
GDPKCS7_verify
int GDPKCS7_verify(struct GDPKCS7 *p7, const struct GDX509List *certs, const struct GDX509List *anchors, struct GDStream *indata, struct GDStream *out, int flags)
Verify a PKCS7 signedData structure.
GDCryptoKeyStore.h
GDPKCS7_encrypt
struct GDPKCS7 * GDPKCS7_encrypt(struct GDX509List *certs, struct GDStream *in, const struct GDCipher *cipher, int flags)
Create a PKCS7 envelopedData structure.
GDPKCS7_NOCERTS
const int GDPKCS7_NOCERTS
GDPKCS7_NOCRL
const int GDPKCS7_NOCRL
GDPKCS7_read
struct GDPKCS7 * GDPKCS7_read(struct GDStream *stream, int flags)
Deserialize ASN.1/DER encoding to a PKCS7 structure.
GDPKCS7_NOVERIFY
const int GDPKCS7_NOVERIFY
GDPKCS7_SMIME_write
int GDPKCS7_SMIME_write(struct GDStream *stream, struct GDPKCS7 *p7, struct GDStream *data, int flags)
Serialize a PKCS7 structure to SMIME encoding.
GDPKCS7_ENCRYPTED
const int GDPKCS7_ENCRYPTED
PKCS7 content-type:pkcs7-encryptedData.
GDPKCS7_NOSMIMECAP
const int GDPKCS7_NOSMIMECAP
GDPKCS7_DIGEST
const int GDPKCS7_DIGEST
PKCS7 content-type:pkcs7-digestData.
GDPKCS7_ENVELOPED
const int GDPKCS7_ENVELOPED
PKCS7 content-type:pkcs7-envelopedData.
GDPKCS7_final
int GDPKCS7_final(struct GDPKCS7 *p7, struct GDStream *data, int flags)
Finalize a PKCS7 structure.
GDDigest
int GDDigest(const void *data, size_t data_sz, void *md, unsigned int *md_sz, const struct GDDigest *type)
Calculate a digest.
GDPKCS7_add_signer
struct GDPKCS7 * GDPKCS7_add_signer(const struct GDX509 *signcert, struct GDKey *pkey, struct GDX509List *certs, const struct GDDigest *md, int flags)
Add signer information to a PKCS7 structure.
GDPKCS7_REUSE_DIGEST
const int GDPKCS7_REUSE_DIGEST
GDPKCS7_DATA
const int GDPKCS7_DATA
PKCS7 content-type:pkcs7-data.
GDCryptoAlgorithms.h
GDPKCS7_SIGNED
const int GDPKCS7_SIGNED
PKCS7 content-type:pkcs7-signedData.
GDPKCS7_type
int GDPKCS7_type(struct GDPKCS7 *p7, int flags)
Retrieve the type of PKCS7 structure.
GDPKCS7_get_signers
const struct GDX509List * GDPKCS7_get_signers(struct GDPKCS7 *p7, int flags)
Retrieve the signer's certificate(s).
GDPKCS7_TEXT
const int GDPKCS7_TEXT
PKCS7 flags.
GDPKCS7_NOINTERN
const int GDPKCS7_NOINTERN
GDPKCS7_PARTIAL
const int GDPKCS7_PARTIAL
GDPKCS7_NOSIGS
const int GDPKCS7_NOSIGS
GDStream.h
GDCipher
int GDCipher(struct GDCipherContext *ctx, void *out_data, const void *in_data, unsigned int in_data_sz)
Encipher or decipher.
GDPKCS7_CRLFEOL
const int GDPKCS7_CRLFEOL
GDPKCS7_STREAM
const int GDPKCS7_STREAM
GDPKCS7_DETACHED
const int GDPKCS7_DETACHED
GDPKCS7_NOATTR
const int GDPKCS7_NOATTR
GDCryptoError.h
GDPKCS7_write
int GDPKCS7_write(struct GDStream *stream, struct GDPKCS7 *p7, int flags)
Serialize a PKCS7 structure to ASN.1/DER encoding.
GDPKCS7_decrypt
int GDPKCS7_decrypt(struct GDPKCS7 *p7, struct GDKey *pkey, const struct GDX509 *cert, struct GDStream *data, int flags)
Decrypt a PKCS7 envelopedData structure.
GDPKCS7_NOOLDMIMETYPE
const int GDPKCS7_NOOLDMIMETYPE
GDPKCS7_USE_KEYID
const int GDPKCS7_USE_KEYID
GDPKCS7_NOCHAIN
const int GDPKCS7_NOCHAIN