Lines Matching refs:cms
1 /* apps/cms.c */
54 /* CMS utility function */
67 #include <openssl/cms.h>
73 static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
115 CMS_ContentInfo *cms = NULL, *rcms = NULL;
593 BIO_printf (bio_err, "Usage cms [options] cert.pem ...\n");
599 BIO_printf (bio_err, "-cmsout output CMS structure\n");
799 cms = SMIME_read_CMS(in, &indata);
801 cms = PEM_read_bio_CMS(in, NULL, NULL, NULL);
803 cms = d2i_CMS_bio(in, NULL);
806 BIO_printf(bio_err, "Bad input format for CMS file\n");
810 if (!cms)
827 allcerts = CMS_get1_certs(cms);
903 cms = CMS_data_create(in, flags);
907 cms = CMS_digest_create(in, sign_md, flags);
911 cms = CMS_compress(in, -1, flags);
916 cms = CMS_encrypt(encerts, in, cipher, flags);
917 if (!cms)
921 if (!CMS_add0_recipient_key(cms, NID_undef,
935 if (!CMS_add0_recipient_password(cms,
943 if (!CMS_final(cms, in, NULL, flags))
949 cms = CMS_EncryptedData_encrypt(in, cipher,
959 sis = CMS_get0_SignerInfos(cms);
966 CMS_ContentInfo_free(cms);
967 cms = srcms;
984 cms = CMS_sign(NULL, NULL, other, in, flags);
985 if (!cms)
988 CMS_set1_eContentType(cms, econtent_type);
1017 si = CMS_add1_signer(cms, signer, key, sign_md, flags);
1030 if (!CMS_final(cms, in, NULL, flags))
1035 if (!cms)
1037 BIO_printf(bio_err, "Error creating CMS structure\n");
1045 CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags);
1049 if (!CMS_decrypt_set1_key(cms,
1054 "Error decrypting CMS using secret key\n");
1061 if (!CMS_decrypt_set1_pkey(cms, key, recip))
1064 "Error decrypting CMS using private key\n");
1071 if (!CMS_decrypt_set1_password(cms, pwri_pass, -1))
1074 "Error decrypting CMS using password\n");
1079 if (!CMS_decrypt(cms, NULL, NULL, indata, out, flags))
1081 BIO_printf(bio_err, "Error decrypting CMS structure\n");
1087 if (!CMS_data(cms, out, flags))
1092 if (!CMS_uncompress(cms, indata, out, flags))
1097 if (CMS_digest_verify(cms, indata, out, flags) > 0)
1107 if (!CMS_EncryptedData_decrypt(cms, secret_key, secret_keylen,
1113 if (CMS_verify(cms, other, store, indata, out, flags) > 0)
1125 signers = CMS_get0_signers(cms);
1137 receipt_request_print(bio_err, cms);
1142 if (CMS_verify_receipt(rcms, cms, other, store, flags) > 0)
1155 CMS_ContentInfo_print_ctx(out, cms, 0, NULL);
1166 ret = SMIME_write_CMS(out, cms, indata, flags);
1168 ret = SMIME_write_CMS(out, cms, in, flags);
1171 ret = PEM_write_bio_CMS_stream(out, cms, in, flags);
1173 ret = i2d_CMS_bio_stream(out,cms, in, flags);
1176 BIO_printf(bio_err, "Bad output format for CMS file\n");
1218 CMS_ContentInfo_free(cms);
1282 static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
1291 sis = CMS_get0_SignerInfos(cms);