TrustCore SDK NanoCert API reference  version 7.0
pkcs7.h
Go to the documentation of this file.
1 /*
2  * pkcs7.h
3  *
4  * PKCS#7 Parser and utilities routines
5  *
6  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
7  * Proprietary and Confidential Material.
8  *
9  */
19 #ifndef __PKCS7_HEADER__
20 #define __PKCS7_HEADER__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /*------------------------------------------------------------------*/
27 
28 /* PKCS7_signData flags */
29 #define PKCS7_EXTERNAL_SIGNATURES 0x01
30 
31 /* type definitions */
32 
33 struct ASN1_ITEM;
34 
35 struct DER_ITEM;
36 
37 struct AsymmetricKey;
38 
39 enum encryptedContentType;
40 
41 
76 typedef struct Attribute
77 {
78  const ubyte* typeOID;
79  ubyte4 type; /* id|tag */
80  ubyte* value;
81  ubyte4 valueLen;
82 } Attribute;
83 
91 typedef struct signerInfo {
96  struct ASN1_ITEM* pIssuer; /* signer certificate's issuer */
101  struct ASN1_ITEM* pSerialNumber; /* signer certificate's issuer specific serial number */
106  CStream cs; /* common stream for both issuer and serial number */
111  AsymmetricKey* pKey; /* private key */
121  const ubyte* digestAlgoOID; /* must point to one of the constants in oiddefs.h */
125  const ubyte* unused;
141  ubyte4 authAttrsLen;
158 } signerInfo;
159 
160 typedef struct signerInfo *signerInfoPtr;
161 
162 /* this callback is used to retrieve the private key that
163  corresponds to an issuer and serial number; key will
164  be released by PKCS7 stack */
231 typedef MSTATUS (*PKCS7_GetPrivateKey)(const void* arg,
232  CStream cs,
233  struct ASN1_ITEM* pSerialNumber,
234  struct ASN1_ITEM* pIssuerName,
235  struct AsymmetricKey* pKey);
236 
237 /* this callback is used to verify that this certificate is recognized
238  as valid */
282 typedef MSTATUS (*PKCS7_ValidateRootCertificate)(const void* arg,
283  CStream cs,
284  struct ASN1_ITEM* pCertificate,
285  sbyte4 chainLength);
286 
287 /* this callback is used to get a certificate given the issuer name and
288  serial number; the ppCertificate will be released by the PKCS7 stack */
333 typedef MSTATUS (*PKCS7_GetCertificate)(const void* arg,
334  CStream cs,
335  struct ASN1_ITEM* pSerialNumber,
336  struct ASN1_ITEM* pIssuerName,
337  ubyte** ppCertificate,
338  ubyte4* certificateLen);
339 /* used by PKCS#12 */
352 typedef struct PKCS7_Callbacks
353 {
354  PKCS7_GetPrivateKey getPrivKeyFun;
356  PKCS7_GetCertificate getCertFun;
358 
359 /*------------------------------------------------------------------*/
360 /* exported routines */
361 #ifdef __ENABLE_MOCANA_PKCS7__
362 
363 /* this routine takes a pointer to the root item of a parsed PKCS7
364  message (by ASN1_Parse) and returns the pointer to the first
365  certificate in the message. If the PKCS7 contains several
366  certificates, they are the siblings of the first one */
367 
408 MOC_EXTERN MSTATUS
409 PKCS7_GetCertificates(struct ASN1_ITEM* pRootItem, CStream s,
410  struct ASN1_ITEM** ppFirstCertificate);
411 
499 MOC_EXTERN MSTATUS
500 PKCS7_VerifySignedData(MOC_ASYM(hwAccelDescr hwAccelCtx)
501  struct ASN1_ITEM* pSignedData, CStream s,
502  /* getCertFun can be NULL, if certificates
503  * are included in signedData
504  */
505  const void* callbackArg,
506  PKCS7_GetCertificate getCertFun,
508  const ubyte* payLoad, /* for detached signatures */
509  ubyte4 payLoadLen,
510  sbyte4* numKnownSigners);
511 
598 MOC_EXTERN MSTATUS
599 PKCS7_DecryptEnvelopedDataAux( MOC_HW(hwAccelDescr hwAccelCtx)
600  struct ASN1_ITEM* pEnvelopedData, CStream s,
601  const void* callbackArg,
602  PKCS7_GetPrivateKey getPrivateKeyFun,
603  enum encryptedContentType* pType,
604  struct ASN1_ITEM** ppEncryptedContent,
605  BulkCtx* ppBulkCtx,
606  const BulkEncryptionAlgo** ppBulkAlgo,
607  ubyte iv[/*16=MAX_IV_SIZE*/]);
608 
652 MOC_EXTERN MSTATUS
653 PKCS7_DecryptEnvelopedData( MOC_HW(hwAccelDescr hwAccelCtx)
654  struct ASN1_ITEM* pEnvelopedData, CStream s,
655  const void* callbackArg,
656  PKCS7_GetPrivateKey getPrivateKeyFun,
657  ubyte** decryptedInfo, sbyte4* decryptedInfoLen);
658 
756 MOC_EXTERN MSTATUS
757 PKCS7_EnvelopData( MOC_HW(hwAccelDescr hwAccelCtx)
758  struct DER_ITEM* pStart, /* can be null */
759  struct DER_ITEM* pParent, /* can be null */
760  struct ASN1_ITEM* pCACertificatesParseRoots[/*numCACerts*/],
761  CStream pStreams[/*numCACerts*/],
762  sbyte4 numCACerts,
763  const ubyte* encryptAlgoOID,
764  RNGFun rngFun, void* rngFunArg,
765  const ubyte* pPayLoad, ubyte4 payLoadLen,
766  ubyte** ppEnveloped, ubyte4* pEnvelopedLen);
767 
844 MOC_EXTERN MSTATUS
845 PKCS7_EnvelopDataWoaep( MOC_HW(hwAccelDescr hwAccelCtx)
846  struct DER_ITEM* pStart, /* can be null */
847  struct DER_ITEM* pParent, /* can be null */
848  struct ASN1_ITEM* pCACertificatesParseRoots[/*numCACerts*/],
849  CStream pStreams[/*numCACerts*/],
850  sbyte4 numCACerts,
851  const ubyte* encryptAlgoOID,
852  RNGFun rngFun, void* rngFunArg,
853  ubyte isOaep, ubyte4 oaepHashAlgo, sbyte *pOaepLabel,
854  const ubyte* pPayLoad, ubyte4 payLoadLen,
855  ubyte** ppEnveloped, ubyte4* pEnvelopedLen);
856 
992 MOC_EXTERN MSTATUS
993 PKCS7_SignData(MOC_ASYM(hwAccelDescr hwAccelCtx)
994  ubyte4 flags,
995  struct DER_ITEM* pStart, /* can be null */
996  struct DER_ITEM* pParent,
997  struct ASN1_ITEM* pCACertificatesParseRoots[/*numCACerts*/], /* can be null */
998  CStream pCAStreams[/*numCACerts*/], sbyte4 numCACerts,
999  struct ASN1_ITEM* pCrlsParseRoots[/*numCrls*/], /* can be null */
1000  CStream pCrlStreams[/*numCrls*/], sbyte4 numCrls,
1001  signerInfoPtr *pSignerInfos, /* if NULL, will create degenerate SignedData */
1002  ubyte4 numSigners, /* number of signers */
1003  const ubyte* payLoadType, /* if NULL, will create degenerate SignedData */
1004  const ubyte* pPayLoad, ubyte4 payLoadLen,
1005  RNGFun rngFun, /* this can be NULL for degenerate SignedData */
1006  void* rngFunArg, /* this can be NULL for degenerate SignedData */
1007  ubyte** ppSigned, ubyte4* pSignedLen);
1008 
1093 MOC_EXTERN MSTATUS
1094 PKCS7_DigestData( MOC_HASH(hwAccelDescr hwAccelCtx)
1095  struct DER_ITEM* pStart, /* can be null */
1096  struct DER_ITEM* pParent,
1097  const ubyte* payLoadType, /* OID can be null then will used pkcs7_data_OID */
1098  ubyte hashType,
1099  const ubyte* pPayLoad, ubyte4 payLoadLen,
1100  ubyte** ppDigested, ubyte4* pDigestedLen);
1101 
1102 
1163 MOC_EXTERN MSTATUS
1164 PKCS7_GetSignerDigestAlgo( struct ASN1_ITEM* pSignerInfo, CStream cs, ubyte* hashAlgoId);
1165 
1221 MOC_EXTERN MSTATUS
1222 PKCS7_GetSignerSignatureAlgo( struct ASN1_ITEM* pSignerInfo, CStream cs, ubyte* pubKeyAlgoId);
1223 
1264 MOC_EXTERN MSTATUS
1265 PKCS7_GetSignerSignedAttributes( struct ASN1_ITEM* pSignerInfo,
1266  struct ASN1_ITEM* *ppFirstSignedAttribute);
1267 
1308 MOC_EXTERN MSTATUS
1309 PKCS7_GetSignerUnsignedAttributes( struct ASN1_ITEM* pSignerInfo,
1310  struct ASN1_ITEM* *ppFirstUnsignedAttribute);
1311 
1312 /*------------------------------------------------------------------*/
1313 
1314 typedef enum {
1315  success = 0,
1316  failed = 2,
1317  pending = 3,
1318  noSupport = 4,
1319  confirmRequired = 5,
1320  popRequired = 6,
1321  partial = 7
1322 } CMCStatus;
1323 
1324 typedef struct cmcSignerInfo {
1328  signerInfo *pSignerInfo;
1333  struct ASN1_ITEM* pSubjectKeyIdentifier;
1334 
1335 } cmcSignerInfo;
1336 
1337 typedef struct CertsData
1338 {
1339  ubyte *pCertData;
1340  ubyte4 certDataLen;
1341 } CERTS_DATA;
1342 
1343 typedef struct taggedContent
1344 {
1345  ubyte *pData;
1346  ubyte4 dataLen;
1347 } taggedContent;
1348 
1349 typedef struct taggedAttribute
1350 {
1351  ubyte4 bodyPartId;
1352  ubyte *pAttributeTypeOid;
1353  taggedContent *pTaggedAttributeValues;
1354  ubyte4 numAttributeValues;
1355 } taggedAttribute;
1356 
1357 typedef struct taggedContentInfo
1358 {
1359  ubyte4 bodyPartId;
1360  /* ContentInfo */
1361  taggedContent *pTaggedContentInfo;
1362 } taggedContentInfo;
1363 
1364 typedef struct otherMsg
1365 {
1366  ubyte4 bodyPartId;
1367  ubyte *pOtherMsgTypeOid;
1368  /*otherMsgValue*/
1369  taggedContent *pOtherMsgValue;
1370 } otherMsg;
1371 
1372 typedef struct cmcSignerInfo *cmcSignerInfoPtr;
1373 
1374 MOC_EXTERN MSTATUS
1375 CMC_createPKIDataEx(taggedAttribute pTaggedAttributes[], ubyte4 numTaggedAttrs, ubyte *pDerCertificateRequest, ubyte4 derCertificateReqLen, taggedContentInfo pTaggedContentInfos[], ubyte4 numTaggedContents, otherMsg pOtherMsgs[], ubyte4 numOtherMsgs, ubyte **ppBuffer, ubyte4 *pBufferLen);
1376 
1377 MOC_EXTERN MSTATUS
1378 CMC_processCmsSequence(ASN1_ITEM *pPKIInputData, CStream stream, ubyte4 *pBodyPartsList, ubyte4 numBodyParts, byteBoolean isResponseData, ASN1_ITEMPTR **ppEnvelopDataItems, ubyte4 *pNumEnvelopDataItems);
1379 
1380 MOC_EXTERN MSTATUS
1381 CMC_processControlSequence(ASN1_ITEM *pPKIInputData, CStream stream, ubyte *pBatchOID, ubyte4 **ppBodyPartIds, ubyte4 *pNumBodyPartIds);
1382 
1383 MOC_EXTERN MSTATUS
1384 CMC_processOtherMsgSequence(ASN1_ITEM *pPKIInputData, CStream stream, ubyte **ppOutData, ubyte4 *pOutDataLen, byteBoolean isResponseData);
1385 
1386 MOC_EXTERN MSTATUS
1387 CMC_verifyAttestationReqType(ASN1_ITEM *pPKIInputData, CStream stream, byteBoolean *pAttestFlow, ubyte **ppOid);
1388 
1389 MOC_EXTERN MSTATUS
1390 CMC_createPKIData(ASN1_ITEMPTR pControlItem, CStream *controlStream, ASN1_ITEMPTR pReqItem, CStream *reqStream, ubyte **ppBuffer, ubyte4 *pBufferLen);
1391 
1392 MOC_EXTERN MSTATUS
1393 CMC_getPKIResponse(ASN1_ITEM* pRootItem, CStream stream, ASN1_ITEM **ppPkiResponse);
1394 
1395 MOC_EXTERN MSTATUS
1396 CMC_getPKIData(ASN1_ITEM* pRootItem, CStream stream, ASN1_ITEM **ppPkiRequest);
1397 #if defined(__ENABLE_MOCANA_AIDE_SERVER__)
1398 MOC_EXTERN MSTATUS
1399 CMC_addCMCStatusInfoV2(CMCStatus status, sbyte4 referanceIds[], sbyte4 numRefIds, ubyte **ppBuffer, ubyte4 *pBufferLen);
1400 MOC_EXTERN MSTATUS
1401 CMC_addTaggedAttribute(sbyte4 bodyPartID, ubyte *attrTypeOid, ubyte *attrValueData, ubyte4 attrValueLen, ubyte **ppBuffer, ubyte4 *pBufferLen);
1402 MOC_EXTERN MSTATUS
1403 CMC_createSimplePKIMessage(CERTS_DATA *pCertsData, sbyte4 certDataLen, ubyte **ppPkiMessage, ubyte4 *pPkiMessageLen);
1404 MOC_EXTERN MSTATUS
1405 CMC_createFullPKIMessage(ubyte* pSignerCertBytes, ubyte4 signerCertByteLen, AsymmetricKey *pSignerKey, CERTS_DATA *pCertsData, sbyte4 certDataLen, intBoolean isAttest, ubyte *pEkCertData, ubyte4 ekCertDataLen, ubyte *pOtherMsgData, ubyte4 otherMsgDataLen, ubyte **ppPkiMessage, ubyte4 *pPkiMessageLen);
1406 
1407 MOC_EXTERN MSTATUS
1408 CMC_createCMSEnvelopForKekri(ubyte *encryptAlgoOID, BulkEncryptionAlgo* pBulkEncryptionAlgo, sbyte4 keyLength,
1409  ubyte *decryptKeyIdentifierData, ubyte4 decryptKeyIdentifierDataLen,
1410  ubyte *pPreSharedKey, ubyte4 preSharedKeyLen,
1411  ubyte *pSecret, ubyte4 secretLen,
1412  ubyte *pPayload, ubyte4 payloadLen,
1413  ubyte** ppOutData, ubyte4 *pOutDataLen);
1414 
1415 MOC_EXTERN MSTATUS
1416 CMC_createCMSEnvelopForKtri(ubyte *encryptAlgoOID,
1417  ubyte *pPreSharedCert, ubyte4 preSharedCertLen,
1418  ubyte *pPayload, ubyte4 payloadLen,
1419  ubyte** ppRetKeyData, ubyte4 *pRetKeyDataLen);
1420 
1421 #endif
1422 
1549 MOC_EXTERN MSTATUS
1550 CMC_SignData(MOC_ASYM(hwAccelDescr hwAccelCtx)
1551  ubyte4 flags,
1552  struct DER_ITEM* pStart, /* can be null */
1553  struct DER_ITEM* pParent,
1554  struct ASN1_ITEM* pCACertificatesParseRoots[/*numCACerts*/], /* can be null */
1555  CStream pCAStreams[/*numCACerts*/], sbyte4 numCACerts,
1556  struct ASN1_ITEM* pCrlsParseRoots[/*numCrls*/], /* can be null */
1557  CStream pCrlStreams[/*numCrls*/], sbyte4 numCrls,
1558  cmcSignerInfoPtr *pCmcSignerInfos, /* if NULL, will create degenerate SignedData */
1559  ubyte4 numSigners, /* number of signers */
1560  const ubyte* payLoadType, /* if NULL, will create degenerate SignedData */
1561  const ubyte* pPayLoad, ubyte4 payLoadLen,
1562  RNGFun rngFun, /* this can be NULL for degenerate SignedData */
1563  void* rngFunArg, /* this can be NULL for degenerate SignedData */
1564  ubyte** ppSigned, ubyte4* pSignedLen);
1565 
1566 #endif /*#ifdef __ENABLE_MOCANA_PKCS7__*/
1567 
1568 #ifdef __cplusplus
1569 }
1570 #endif
1571 
1572 #endif /*#ifndef __PKCS7_HEADER__ */
MOC_EXTERN MSTATUS PKCS7_GetSignerDigestAlgo(struct ASN1_ITEM *pSignerInfo, CStream cs, ubyte *hashAlgoId)
Get a SignerInfo object's digest hash function identifier.
AsymmetricKey * pKey
Pointer to AsymmetricKey structure that contains the signer's private key.
Definition: pkcs7.h:111
MOC_EXTERN MSTATUS PKCS7_DecryptEnvelopedDataAux(MOC_HW(hwAccelDescr hwAccelCtx) struct ASN1_ITEM *pEnvelopedData, CStream s, const void *callbackArg, PKCS7_GetPrivateKey getPrivateKeyFun, enum encryptedContentType *pType, struct ASN1_ITEM **ppEncryptedContent, BulkCtx *ppBulkCtx, const BulkEncryptionAlgo **ppBulkAlgo, ubyte iv[])
Decrypt an EnvelopedData object and get its encryption details.
MOC_EXTERN MSTATUS PKCS7_GetSignerSignatureAlgo(struct ASN1_ITEM *pSignerInfo, CStream cs, ubyte *pubKeyAlgoId)
Get a SignerInfo object's digest encryption algorithm identifier.
struct ASN1_ITEM * pSerialNumber
ASN1_ITEMPTR for the SerialNumber object in this signer's certificate.
Definition: pkcs7.h:101
MOC_EXTERN MSTATUS PKCS7_GetSignerUnsignedAttributes(struct ASN1_ITEM *pSignerInfo, struct ASN1_ITEM **ppFirstUnsignedAttribute)
Get the first unsigned attribute in a DER-encoded, ASN.1 SignerInfo object.
Information about a SignedData object's signer.
Definition: pkcs7.h:91
const ubyte * digestAlgoOID
Pointer to the OID for the message digest method to use for this signer.
Definition: pkcs7.h:121
MSTATUS(* PKCS7_ValidateRootCertificate)(const void *arg, CStream cs, struct ASN1_ITEM *pCertificate, sbyte4 chainLength)
Validate the certificates in a PKCS #7 message.
Definition: pkcs7.h:282
MOC_EXTERN MSTATUS PKCS7_GetSignerSignedAttributes(struct ASN1_ITEM *pSignerInfo, struct ASN1_ITEM **ppFirstSignedAttribute)
Get the first signed attribute in a DER-encoded, ASN.1 SignerInfo object.
MOC_EXTERN MSTATUS PKCS7_EnvelopData(MOC_HW(hwAccelDescr hwAccelCtx) struct DER_ITEM *pStart, struct DER_ITEM *pParent, struct ASN1_ITEM *pCACertificatesParseRoots[], CStream pStreams[], sbyte4 numCACerts, const ubyte *encryptAlgoOID, RNGFun rngFun, void *rngFunArg, const ubyte *pPayLoad, ubyte4 payLoadLen, ubyte **ppEnveloped, ubyte4 *pEnvelopedLen)
Create a DER-encoded, version 0, ASN.1 EnvelopedData object containing a given payload.
MOC_EXTERN MSTATUS PKCS7_DecryptEnvelopedData(MOC_HW(hwAccelDescr hwAccelCtx) struct ASN1_ITEM *pEnvelopedData, CStream s, const void *callbackArg, PKCS7_GetPrivateKey getPrivateKeyFun, ubyte **decryptedInfo, sbyte4 *decryptedInfoLen)
Extract and decrypt the encrypted content of an EnvelopedData object.
MOC_EXTERN MSTATUS PKCS7_SignData(MOC_ASYM(hwAccelDescr hwAccelCtx) ubyte4 flags, struct DER_ITEM *pStart, struct DER_ITEM *pParent, struct ASN1_ITEM *pCACertificatesParseRoots[], CStream pCAStreams[], sbyte4 numCACerts, struct ASN1_ITEM *pCrlsParseRoots[], CStream pCrlStreams[], sbyte4 numCrls, signerInfoPtr *pSignerInfos, ubyte4 numSigners, const ubyte *payLoadType, const ubyte *pPayLoad, ubyte4 payLoadLen, RNGFun rngFun, void *rngFunArg, ubyte **ppSigned, ubyte4 *pSignedLen)
Create a DER-encoded, version 1, ASN.1 SignedData object for data internal or external to the SignedD...
struct ASN1_ITEM * pIssuer
ASN1_ITEMPTR for the Issuer object in this signer's certificate.
Definition: pkcs7.h:96
MOC_EXTERN MSTATUS CMC_SignData(MOC_ASYM(hwAccelDescr hwAccelCtx) ubyte4 flags, struct DER_ITEM *pStart, struct DER_ITEM *pParent, struct ASN1_ITEM *pCACertificatesParseRoots[], CStream pCAStreams[], sbyte4 numCACerts, struct ASN1_ITEM *pCrlsParseRoots[], CStream pCrlStreams[], sbyte4 numCrls, cmcSignerInfoPtr *pCmcSignerInfos, ubyte4 numSigners, const ubyte *payLoadType, const ubyte *pPayLoad, ubyte4 payLoadLen, RNGFun rngFun, void *rngFunArg, ubyte **ppSigned, ubyte4 *pSignedLen)
Create a DER-encoded, version 1, ASN.1 SignedData object for data internal or external to the SignedD...
Information about an attribute of a SignedData object.
Definition: pkcs7.h:76
Attribute * pAuthAttrs
NULL or pointer to an Attributes structure for the signer's authenticated attributes.
Definition: pkcs7.h:137
CStream cs
CStream for the certificate referenced by pSerialNumber and pIssuer.
Definition: pkcs7.h:106
MSTATUS(* PKCS7_GetCertificate)(const void *arg, CStream cs, struct ASN1_ITEM *pSerialNumber, struct ASN1_ITEM *pIssuerName, ubyte **ppCertificate, ubyte4 *certificateLen)
Get a certificate for a given issuer name and serial number.
Definition: pkcs7.h:333
Pointers to PKCS #7 callback functions required by PKCS #12 functions.
Definition: pkcs7.h:352
MOC_EXTERN MSTATUS PKCS7_DigestData(MOC_HASH(hwAccelDescr hwAccelCtx) struct DER_ITEM *pStart, struct DER_ITEM *pParent, const ubyte *payLoadType, ubyte hashType, const ubyte *pPayLoad, ubyte4 payLoadLen, ubyte **ppDigested, ubyte4 *pDigestedLen)
Create a DER-encoded, ASN.1 DigestedData object for the given data.
ubyte4 authAttrsLen
Size of the authenticated attributes, pAuthAttrs.
Definition: pkcs7.h:141
MOC_EXTERN MSTATUS PKCS7_GetCertificates(struct ASN1_ITEM *pRootItem, CStream s, struct ASN1_ITEM **ppFirstCertificate)
If a given CStream contains a PKCS #7 SignedData object, get the first certificate.
Attribute * pUnauthAttrs
NULL or pointer to an Attributes structure for the signer's non-authenticated attributes.
Definition: pkcs7.h:153
ubyte4 unauthAttrsLen
Size of the authenticated attributes, pUnauthAttrs.
Definition: pkcs7.h:157
MOC_EXTERN MSTATUS PKCS7_VerifySignedData(MOC_ASYM(hwAccelDescr hwAccelCtx) struct ASN1_ITEM *pSignedData, CStream s, const void *callbackArg, PKCS7_GetCertificate getCertFun, PKCS7_ValidateRootCertificate valCertFun, const ubyte *payLoad, ubyte4 payLoadLen, sbyte4 *numKnownSigners)
Verify the signature of a SignedData object that contains the signed data.
MSTATUS(* PKCS7_GetPrivateKey)(const void *arg, CStream cs, struct ASN1_ITEM *pSerialNumber, struct ASN1_ITEM *pIssuerName, struct AsymmetricKey *pKey)
Get the private key associated with a given certificate in a PKCS #7 message (CMS message stream)...
Definition: pkcs7.h:231
MOC_EXTERN MSTATUS PKCS7_EnvelopDataWoaep(MOC_HW(hwAccelDescr hwAccelCtx) struct DER_ITEM *pStart, struct DER_ITEM *pParent, struct ASN1_ITEM *pCACertificatesParseRoots[], CStream pStreams[], sbyte4 numCACerts, const ubyte *encryptAlgoOID, RNGFun rngFun, void *rngFunArg, ubyte isOaep, ubyte4 oaepHashAlgo, sbyte *pOaepLabel, const ubyte *pPayLoad, ubyte4 payLoadLen, ubyte **ppEnveloped, ubyte4 *pEnvelopedLen)
Create a DER-encoded, version 0, ASN.1 EnvelopedData object containing a given payload.
Structure to hold function pointers to symmetric key cipher methods.
Definition: crypto.h:48
const ubyte * unused
For future use.
Definition: pkcs7.h:125