Lines Matching defs:cms

1 /* crypto/cms/cms_lib.c */
60 #include "cms.h"
71 const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms)
73 return cms->contentType;
78 CMS_ContentInfo *cms;
79 cms = CMS_ContentInfo_new();
80 if (cms)
82 cms->contentType = OBJ_nid2obj(NID_pkcs7_data);
84 CMS_set_detached(cms, 0);
86 return cms;
89 BIO *cms_content_bio(CMS_ContentInfo *cms)
91 ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
105 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont)
111 cont = cms_content_bio(cms);
117 switch (OBJ_obj2nid(cms->contentType))
124 cmsbio = cms_SignedData_init_bio(cms);
128 cmsbio = cms_DigestedData_init_bio(cms);
132 cmsbio = cms_CompressedData_init_bio(cms);
137 cmsbio = cms_EncryptedData_init_bio(cms);
141 cmsbio = cms_EnvelopedData_init_bio(cms);
158 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *cmsbio)
160 ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
183 switch (OBJ_obj2nid(cms->contentType))
194 return cms_SignedData_final(cms, cmsbio);
197 return cms_DigestedData_do_final(cms, cmsbio, 0);
209 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms)
211 switch (OBJ_obj2nid(cms->contentType))
215 return &cms->d.data;
218 return &cms->d.signedData->encapContentInfo->eContent;
221 return &cms->d.envelopedData->encryptedContentInfo->encryptedContent;
224 return &cms->d.digestedData->encapContentInfo->eContent;
227 return &cms->d.encryptedData->encryptedContentInfo->encryptedContent;
230 return &cms->d.authenticatedData->encapContentInfo->eContent;
233 return &cms->d.compressedData->encapContentInfo->eContent;
236 if (cms->d.other->type == V_ASN1_OCTET_STRING)
237 return &cms->d.other->value.octet_string;
248 static ASN1_OBJECT **cms_get0_econtent_type(CMS_ContentInfo *cms)
250 switch (OBJ_obj2nid(cms->contentType))
254 return &cms->d.signedData->encapContentInfo->eContentType;
257 return &cms->d.envelopedData->encryptedContentInfo->contentType;
260 return &cms->d.digestedData->encapContentInfo->eContentType;
263 return &cms->d.encryptedData->encryptedContentInfo->contentType;
266 return &cms->d.authenticatedData->encapContentInfo->eContentType;
269 return &cms->d.compressedData->encapContentInfo->eContentType;
279 const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms)
282 petype = cms_get0_econtent_type(cms);
288 int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid)
291 petype = cms_get0_econtent_type(cms);
304 int CMS_is_detached(CMS_ContentInfo *cms)
307 pos = CMS_get0_content(cms);
315 int CMS_set_detached(CMS_ContentInfo *cms, int detached)
318 pos = CMS_get0_content(cms);
419 static STACK_OF(CMS_CertificateChoices) **cms_get0_certificate_choices(CMS_ContentInfo *cms)
421 switch (OBJ_obj2nid(cms->contentType))
425 return &cms->d.signedData->certificates;
428 return &cms->d.envelopedData->originatorInfo->certificates;
438 CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms)
442 pcerts = cms_get0_certificate_choices(cms);
460 int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert)
465 pcerts = cms_get0_certificate_choices(cms);
481 cch = CMS_add0_CertificateChoices(cms);
489 int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert)
492 r = CMS_add0_cert(cms, cert);
498 static STACK_OF(CMS_RevocationInfoChoice) **cms_get0_revocation_choices(CMS_ContentInfo *cms)
500 switch (OBJ_obj2nid(cms->contentType))
504 return &cms->d.signedData->crls;
507 return &cms->d.envelopedData->originatorInfo->crls;
517 CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms)
521 pcrls = cms_get0_revocation_choices(cms);
539 int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl)
542 rch = CMS_add0_RevocationInfoChoice(cms);
550 int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl)
553 r = CMS_add0_crl(cms, crl);
559 STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms)
565 pcerts = cms_get0_certificate_choices(cms);
592 STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms)
598 pcrls = cms_get0_revocation_choices(cms);