Lines Matching refs:cms

59 #include <openssl/cms.h>
107 CMS_get0_type(const CMS_ContentInfo *cms)
109 return cms->contentType;
116 CMS_ContentInfo *cms;
118 cms = CMS_ContentInfo_new();
119 if (cms != NULL) {
120 cms->contentType = OBJ_nid2obj(NID_pkcs7_data);
122 CMS_set_detached(cms, 0);
124 return cms;
128 cms_content_bio(CMS_ContentInfo *cms)
132 if ((pos = CMS_get0_content(cms)) == NULL)
148 CMS_dataInit(CMS_ContentInfo *cms, BIO *in_content_bio)
153 content_bio = cms_content_bio(cms);
159 switch (OBJ_obj2nid(cms->contentType)) {
163 if ((cms_bio = cms_SignedData_init_bio(cms)) == NULL)
167 if ((cms_bio = cms_DigestedData_init_bio(cms)) == NULL)
171 if ((cms_bio = cms_EncryptedData_init_bio(cms)) == NULL)
175 if ((cms_bio = cms_EnvelopedData_init_bio(cms)) == NULL)
194 CMS_dataFinal(CMS_ContentInfo *cms, BIO *cmsbio)
196 ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
218 switch (OBJ_obj2nid(cms->contentType)) {
228 return cms_SignedData_final(cms, cmsbio);
231 return cms_DigestedData_do_final(cms, cmsbio, 0);
241 CMS_get_version(const CMS_ContentInfo *cms, long *version)
243 switch (OBJ_obj2nid(cms->contentType)) {
245 *version = cms->d.signedData->version;
249 *version = cms->d.envelopedData->version;
253 *version = cms->d.digestedData->version;
257 *version = cms->d.encryptedData->version;
261 *version = cms->d.authenticatedData->version;
265 *version = cms->d.compressedData->version;
289 CMS_get0_content(CMS_ContentInfo *cms)
291 switch (OBJ_obj2nid(cms->contentType)) {
293 return &cms->d.data;
296 return &cms->d.signedData->encapContentInfo->eContent;
299 return &cms->d.envelopedData->encryptedContentInfo->encryptedContent;
302 return &cms->d.digestedData->encapContentInfo->eContent;
305 return &cms->d.encryptedData->encryptedContentInfo->encryptedContent;
308 return &cms->d.authenticatedData->encapContentInfo->eContent;
311 return &cms->d.compressedData->encapContentInfo->eContent;
314 if (cms->d.other->type == V_ASN1_OCTET_STRING)
315 return &cms->d.other->value.octet_string;
328 cms_get0_econtent_type(CMS_ContentInfo *cms)
330 switch (OBJ_obj2nid(cms->contentType)) {
332 return &cms->d.signedData->encapContentInfo->eContentType;
335 return &cms->d.envelopedData->encryptedContentInfo->contentType;
338 return &cms->d.digestedData->encapContentInfo->eContentType;
341 return &cms->d.encryptedData->encryptedContentInfo->contentType;
344 return &cms->d.authenticatedData->encapContentInfo->eContentType;
347 return &cms->d.compressedData->encapContentInfo->eContentType;
356 CMS_get0_eContentType(CMS_ContentInfo *cms)
360 petype = cms_get0_econtent_type(cms);
369 CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid)
373 petype = cms_get0_econtent_type(cms);
389 CMS_is_detached(CMS_ContentInfo *cms)
393 pos = CMS_get0_content(cms);
404 CMS_set_detached(CMS_ContentInfo *cms, int detached)
408 pos = CMS_get0_content(cms);
490 cms_get0_certificate_choices(CMS_ContentInfo *cms)
492 switch (OBJ_obj2nid(cms->contentType)) {
494 return &cms->d.signedData->certificates;
497 if (cms->d.envelopedData->originatorInfo == NULL)
499 return &cms->d.envelopedData->originatorInfo->certificates;
508 CMS_add0_CertificateChoices(CMS_ContentInfo *cms)
513 pcerts = cms_get0_certificate_choices(cms);
533 CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert)
539 pcerts = cms_get0_certificate_choices(cms);
551 cch = CMS_add0_CertificateChoices(cms);
562 CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert)
566 r = CMS_add0_cert(cms, cert);
575 cms_get0_revocation_choices(CMS_ContentInfo *cms)
577 switch (OBJ_obj2nid(cms->contentType)) {
579 return &cms->d.signedData->crls;
582 if (cms->d.envelopedData->originatorInfo == NULL)
584 return &cms->d.envelopedData->originatorInfo->crls;
593 CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms)
598 pcrls = cms_get0_revocation_choices(cms);
618 CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl)
622 rch = CMS_add0_RevocationInfoChoice(cms);
633 CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl)
637 r = CMS_add0_crl(cms, crl);
646 CMS_get1_certs(CMS_ContentInfo *cms)
653 pcerts = cms_get0_certificate_choices(cms);
676 CMS_get1_crls(CMS_ContentInfo *cms)
683 pcrls = cms_get0_revocation_choices(cms);