File indexing completed on 2025-01-18 10:05:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef OPENSSL_CMS_H
0016 # define OPENSSL_CMS_H
0017 # pragma once
0018
0019 # include <openssl/macros.h>
0020 # ifndef OPENSSL_NO_DEPRECATED_3_0
0021 # define HEADER_CMS_H
0022 # endif
0023
0024 # include <openssl/opensslconf.h>
0025
0026 # ifndef OPENSSL_NO_CMS
0027 # include <openssl/x509.h>
0028 # include <openssl/x509v3.h>
0029 # include <openssl/cmserr.h>
0030 # ifdef __cplusplus
0031 extern "C" {
0032 # endif
0033
0034 typedef struct CMS_EnvelopedData_st CMS_EnvelopedData;
0035 typedef struct CMS_ContentInfo_st CMS_ContentInfo;
0036 typedef struct CMS_SignerInfo_st CMS_SignerInfo;
0037 typedef struct CMS_SignedData_st CMS_SignedData;
0038 typedef struct CMS_CertificateChoices CMS_CertificateChoices;
0039 typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
0040 typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
0041 typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
0042 typedef struct CMS_Receipt_st CMS_Receipt;
0043 typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
0044 typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
0045
0046 SKM_DEFINE_STACK_OF_INTERNAL(CMS_SignerInfo, CMS_SignerInfo, CMS_SignerInfo)
0047 #define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
0048 #define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
0049 #define sk_CMS_SignerInfo_new(cmp) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new(ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
0050 #define sk_CMS_SignerInfo_new_null() ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_null())
0051 #define sk_CMS_SignerInfo_new_reserve(cmp, n) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_SignerInfo_compfunc_type(cmp), (n)))
0052 #define sk_CMS_SignerInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_SignerInfo_sk_type(sk), (n))
0053 #define sk_CMS_SignerInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_SignerInfo_sk_type(sk))
0054 #define sk_CMS_SignerInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_SignerInfo_sk_type(sk))
0055 #define sk_CMS_SignerInfo_delete(sk, i) ((CMS_SignerInfo *)OPENSSL_sk_delete(ossl_check_CMS_SignerInfo_sk_type(sk), (i)))
0056 #define sk_CMS_SignerInfo_delete_ptr(sk, ptr) ((CMS_SignerInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)))
0057 #define sk_CMS_SignerInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
0058 #define sk_CMS_SignerInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
0059 #define sk_CMS_SignerInfo_pop(sk) ((CMS_SignerInfo *)OPENSSL_sk_pop(ossl_check_CMS_SignerInfo_sk_type(sk)))
0060 #define sk_CMS_SignerInfo_shift(sk) ((CMS_SignerInfo *)OPENSSL_sk_shift(ossl_check_CMS_SignerInfo_sk_type(sk)))
0061 #define sk_CMS_SignerInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_SignerInfo_sk_type(sk),ossl_check_CMS_SignerInfo_freefunc_type(freefunc))
0062 #define sk_CMS_SignerInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), (idx))
0063 #define sk_CMS_SignerInfo_set(sk, idx, ptr) ((CMS_SignerInfo *)OPENSSL_sk_set(ossl_check_CMS_SignerInfo_sk_type(sk), (idx), ossl_check_CMS_SignerInfo_type(ptr)))
0064 #define sk_CMS_SignerInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
0065 #define sk_CMS_SignerInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
0066 #define sk_CMS_SignerInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), pnum)
0067 #define sk_CMS_SignerInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_SignerInfo_sk_type(sk))
0068 #define sk_CMS_SignerInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_SignerInfo_sk_type(sk))
0069 #define sk_CMS_SignerInfo_dup(sk) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_SignerInfo_sk_type(sk)))
0070 #define sk_CMS_SignerInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_copyfunc_type(copyfunc), ossl_check_CMS_SignerInfo_freefunc_type(freefunc)))
0071 #define sk_CMS_SignerInfo_set_cmp_func(sk, cmp) ((sk_CMS_SignerInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
0072 SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey)
0073 #define sk_CMS_RecipientEncryptedKey_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
0074 #define sk_CMS_RecipientEncryptedKey_value(sk, idx) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), (idx)))
0075 #define sk_CMS_RecipientEncryptedKey_new(cmp) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
0076 #define sk_CMS_RecipientEncryptedKey_new_null() ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_null())
0077 #define sk_CMS_RecipientEncryptedKey_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp), (n)))
0078 #define sk_CMS_RecipientEncryptedKey_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (n))
0079 #define sk_CMS_RecipientEncryptedKey_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
0080 #define sk_CMS_RecipientEncryptedKey_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
0081 #define sk_CMS_RecipientEncryptedKey_delete(sk, i) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (i)))
0082 #define sk_CMS_RecipientEncryptedKey_delete_ptr(sk, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
0083 #define sk_CMS_RecipientEncryptedKey_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
0084 #define sk_CMS_RecipientEncryptedKey_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
0085 #define sk_CMS_RecipientEncryptedKey_pop(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_pop(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
0086 #define sk_CMS_RecipientEncryptedKey_shift(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_shift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
0087 #define sk_CMS_RecipientEncryptedKey_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk),ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc))
0088 #define sk_CMS_RecipientEncryptedKey_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), (idx))
0089 #define sk_CMS_RecipientEncryptedKey_set(sk, idx, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_set(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (idx), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
0090 #define sk_CMS_RecipientEncryptedKey_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
0091 #define sk_CMS_RecipientEncryptedKey_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
0092 #define sk_CMS_RecipientEncryptedKey_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), pnum)
0093 #define sk_CMS_RecipientEncryptedKey_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
0094 #define sk_CMS_RecipientEncryptedKey_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
0095 #define sk_CMS_RecipientEncryptedKey_dup(sk) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)))
0096 #define sk_CMS_RecipientEncryptedKey_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_copyfunc_type(copyfunc), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc)))
0097 #define sk_CMS_RecipientEncryptedKey_set_cmp_func(sk, cmp) ((sk_CMS_RecipientEncryptedKey_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
0098 SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientInfo, CMS_RecipientInfo, CMS_RecipientInfo)
0099 #define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
0100 #define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
0101 #define sk_CMS_RecipientInfo_new(cmp) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new(ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
0102 #define sk_CMS_RecipientInfo_new_null() ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_null())
0103 #define sk_CMS_RecipientInfo_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientInfo_compfunc_type(cmp), (n)))
0104 #define sk_CMS_RecipientInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientInfo_sk_type(sk), (n))
0105 #define sk_CMS_RecipientInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientInfo_sk_type(sk))
0106 #define sk_CMS_RecipientInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientInfo_sk_type(sk))
0107 #define sk_CMS_RecipientInfo_delete(sk, i) ((CMS_RecipientInfo *)OPENSSL_sk_delete(ossl_check_CMS_RecipientInfo_sk_type(sk), (i)))
0108 #define sk_CMS_RecipientInfo_delete_ptr(sk, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)))
0109 #define sk_CMS_RecipientInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
0110 #define sk_CMS_RecipientInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
0111 #define sk_CMS_RecipientInfo_pop(sk) ((CMS_RecipientInfo *)OPENSSL_sk_pop(ossl_check_CMS_RecipientInfo_sk_type(sk)))
0112 #define sk_CMS_RecipientInfo_shift(sk) ((CMS_RecipientInfo *)OPENSSL_sk_shift(ossl_check_CMS_RecipientInfo_sk_type(sk)))
0113 #define sk_CMS_RecipientInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientInfo_sk_type(sk),ossl_check_CMS_RecipientInfo_freefunc_type(freefunc))
0114 #define sk_CMS_RecipientInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), (idx))
0115 #define sk_CMS_RecipientInfo_set(sk, idx, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_set(ossl_check_CMS_RecipientInfo_sk_type(sk), (idx), ossl_check_CMS_RecipientInfo_type(ptr)))
0116 #define sk_CMS_RecipientInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
0117 #define sk_CMS_RecipientInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
0118 #define sk_CMS_RecipientInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), pnum)
0119 #define sk_CMS_RecipientInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientInfo_sk_type(sk))
0120 #define sk_CMS_RecipientInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
0121 #define sk_CMS_RecipientInfo_dup(sk) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientInfo_sk_type(sk)))
0122 #define sk_CMS_RecipientInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_copyfunc_type(copyfunc), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc)))
0123 #define sk_CMS_RecipientInfo_set_cmp_func(sk, cmp) ((sk_CMS_RecipientInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
0124 SKM_DEFINE_STACK_OF_INTERNAL(CMS_RevocationInfoChoice, CMS_RevocationInfoChoice, CMS_RevocationInfoChoice)
0125 #define sk_CMS_RevocationInfoChoice_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
0126 #define sk_CMS_RevocationInfoChoice_value(sk, idx) ((CMS_RevocationInfoChoice *)OPENSSL_sk_value(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), (idx)))
0127 #define sk_CMS_RevocationInfoChoice_new(cmp) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
0128 #define sk_CMS_RevocationInfoChoice_new_null() ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_null())
0129 #define sk_CMS_RevocationInfoChoice_new_reserve(cmp, n) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp), (n)))
0130 #define sk_CMS_RevocationInfoChoice_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (n))
0131 #define sk_CMS_RevocationInfoChoice_free(sk) OPENSSL_sk_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
0132 #define sk_CMS_RevocationInfoChoice_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
0133 #define sk_CMS_RevocationInfoChoice_delete(sk, i) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (i)))
0134 #define sk_CMS_RevocationInfoChoice_delete_ptr(sk, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
0135 #define sk_CMS_RevocationInfoChoice_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
0136 #define sk_CMS_RevocationInfoChoice_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
0137 #define sk_CMS_RevocationInfoChoice_pop(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_pop(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
0138 #define sk_CMS_RevocationInfoChoice_shift(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_shift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
0139 #define sk_CMS_RevocationInfoChoice_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk),ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc))
0140 #define sk_CMS_RevocationInfoChoice_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), (idx))
0141 #define sk_CMS_RevocationInfoChoice_set(sk, idx, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_set(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (idx), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
0142 #define sk_CMS_RevocationInfoChoice_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
0143 #define sk_CMS_RevocationInfoChoice_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
0144 #define sk_CMS_RevocationInfoChoice_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), pnum)
0145 #define sk_CMS_RevocationInfoChoice_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
0146 #define sk_CMS_RevocationInfoChoice_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
0147 #define sk_CMS_RevocationInfoChoice_dup(sk) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_dup(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)))
0148 #define sk_CMS_RevocationInfoChoice_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_copyfunc_type(copyfunc), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc)))
0149 #define sk_CMS_RevocationInfoChoice_set_cmp_func(sk, cmp) ((sk_CMS_RevocationInfoChoice_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
0150
0151
0152 DECLARE_ASN1_ITEM(CMS_EnvelopedData)
0153 DECLARE_ASN1_ALLOC_FUNCTIONS(CMS_SignedData)
0154 DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
0155 DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
0156 DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
0157
0158 CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
0159
0160 # define CMS_SIGNERINFO_ISSUER_SERIAL 0
0161 # define CMS_SIGNERINFO_KEYIDENTIFIER 1
0162
0163 # define CMS_RECIPINFO_NONE -1
0164 # define CMS_RECIPINFO_TRANS 0
0165 # define CMS_RECIPINFO_AGREE 1
0166 # define CMS_RECIPINFO_KEK 2
0167 # define CMS_RECIPINFO_PASS 3
0168 # define CMS_RECIPINFO_OTHER 4
0169
0170
0171
0172 # define CMS_TEXT 0x1
0173 # define CMS_NOCERTS 0x2
0174 # define CMS_NO_CONTENT_VERIFY 0x4
0175 # define CMS_NO_ATTR_VERIFY 0x8
0176 # define CMS_NOSIGS \
0177 (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
0178 # define CMS_NOINTERN 0x10
0179 # define CMS_NO_SIGNER_CERT_VERIFY 0x20
0180 # define CMS_NOVERIFY 0x20
0181 # define CMS_DETACHED 0x40
0182 # define CMS_BINARY 0x80
0183 # define CMS_NOATTR 0x100
0184 # define CMS_NOSMIMECAP 0x200
0185 # define CMS_NOOLDMIMETYPE 0x400
0186 # define CMS_CRLFEOL 0x800
0187 # define CMS_STREAM 0x1000
0188 # define CMS_NOCRL 0x2000
0189 # define CMS_PARTIAL 0x4000
0190 # define CMS_REUSE_DIGEST 0x8000
0191 # define CMS_USE_KEYID 0x10000
0192 # define CMS_DEBUG_DECRYPT 0x20000
0193 # define CMS_KEY_PARAM 0x40000
0194 # define CMS_ASCIICRLF 0x80000
0195 # define CMS_CADES 0x100000
0196 # define CMS_USE_ORIGINATOR_KEYID 0x200000
0197
0198 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
0199
0200 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
0201 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
0202
0203 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
0204 int CMS_is_detached(CMS_ContentInfo *cms);
0205 int CMS_set_detached(CMS_ContentInfo *cms, int detached);
0206
0207 # ifdef OPENSSL_PEM_H
0208 DECLARE_PEM_rw(CMS, CMS_ContentInfo)
0209 # endif
0210 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
0211 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
0212 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
0213
0214 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
0215 int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
0216 int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
0217 int flags);
0218 CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
0219 CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci);
0220 int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
0221
0222 int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
0223 unsigned int flags);
0224 int CMS_final_digest(CMS_ContentInfo *cms,
0225 const unsigned char *md, unsigned int mdlen, BIO *dcont,
0226 unsigned int flags);
0227
0228 CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
0229 STACK_OF(X509) *certs, BIO *data,
0230 unsigned int flags);
0231 CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
0232 STACK_OF(X509) *certs, BIO *data,
0233 unsigned int flags, OSSL_LIB_CTX *libctx,
0234 const char *propq);
0235
0236 CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
0237 X509 *signcert, EVP_PKEY *pkey,
0238 STACK_OF(X509) *certs, unsigned int flags);
0239
0240 int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
0241 CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
0242 CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
0243 OSSL_LIB_CTX *libctx, const char *propq);
0244
0245 int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
0246 unsigned int flags);
0247 CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
0248 unsigned int flags);
0249 CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
0250 unsigned int flags, OSSL_LIB_CTX *libctx,
0251 const char *propq);
0252
0253 int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
0254 const unsigned char *key, size_t keylen,
0255 BIO *dcont, BIO *out, unsigned int flags);
0256 CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
0257 const unsigned char *key,
0258 size_t keylen, unsigned int flags);
0259 CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
0260 const unsigned char *key,
0261 size_t keylen, unsigned int flags,
0262 OSSL_LIB_CTX *libctx,
0263 const char *propq);
0264
0265 int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
0266 const unsigned char *key, size_t keylen);
0267
0268 int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
0269 X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
0270
0271 int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
0272 STACK_OF(X509) *certs,
0273 X509_STORE *store, unsigned int flags);
0274
0275 STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
0276
0277 CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
0278 const EVP_CIPHER *cipher, unsigned int flags);
0279 CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
0280 const EVP_CIPHER *cipher, unsigned int flags,
0281 OSSL_LIB_CTX *libctx, const char *propq);
0282
0283 int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
0284 BIO *dcont, BIO *out, unsigned int flags);
0285
0286 int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
0287 int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
0288 X509 *cert, X509 *peer);
0289 int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
0290 unsigned char *key, size_t keylen,
0291 const unsigned char *id, size_t idlen);
0292 int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
0293 unsigned char *pass, ossl_ssize_t passlen);
0294
0295 STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
0296 int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
0297 EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
0298 CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
0299 CMS_ContentInfo *
0300 CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
0301 const char *propq);
0302 CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
0303 CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
0304 OSSL_LIB_CTX *libctx,
0305 const char *propq);
0306 BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
0307 EVP_PKEY *pkey, X509 *cert,
0308 ASN1_OCTET_STRING *secret, unsigned int flags,
0309 OSSL_LIB_CTX *libctx, const char *propq);
0310
0311 CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
0312 X509 *recip, unsigned int flags);
0313 CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
0314 EVP_PKEY *originatorPrivKey, X509 * originator, unsigned int flags);
0315 int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
0316 int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
0317 int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
0318 EVP_PKEY **pk, X509 **recip,
0319 X509_ALGOR **palg);
0320 int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
0321 ASN1_OCTET_STRING **keyid,
0322 X509_NAME **issuer,
0323 ASN1_INTEGER **sno);
0324
0325 CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
0326 unsigned char *key, size_t keylen,
0327 unsigned char *id, size_t idlen,
0328 ASN1_GENERALIZEDTIME *date,
0329 ASN1_OBJECT *otherTypeId,
0330 ASN1_TYPE *otherType);
0331
0332 int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
0333 X509_ALGOR **palg,
0334 ASN1_OCTET_STRING **pid,
0335 ASN1_GENERALIZEDTIME **pdate,
0336 ASN1_OBJECT **potherid,
0337 ASN1_TYPE **pothertype);
0338
0339 int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
0340 unsigned char *key, size_t keylen);
0341
0342 int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
0343 const unsigned char *id, size_t idlen);
0344
0345 int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
0346 unsigned char *pass,
0347 ossl_ssize_t passlen);
0348
0349 CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
0350 int iter, int wrap_nid,
0351 int pbe_nid,
0352 unsigned char *pass,
0353 ossl_ssize_t passlen,
0354 const EVP_CIPHER *kekciph);
0355
0356 int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
0357 int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
0358
0359 int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
0360 unsigned int flags);
0361 CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
0362
0363 int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
0364 const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
0365
0366 CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
0367 int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
0368 int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
0369 STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
0370
0371 CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
0372 int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
0373 int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
0374 STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
0375
0376 int CMS_SignedData_init(CMS_ContentInfo *cms);
0377 CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
0378 X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
0379 unsigned int flags);
0380 EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
0381 EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
0382 STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
0383
0384 void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
0385 int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
0386 ASN1_OCTET_STRING **keyid,
0387 X509_NAME **issuer, ASN1_INTEGER **sno);
0388 int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
0389 int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
0390 unsigned int flags);
0391 void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
0392 X509 **signer, X509_ALGOR **pdig,
0393 X509_ALGOR **psig);
0394 ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
0395 int CMS_SignerInfo_sign(CMS_SignerInfo *si);
0396 int CMS_SignerInfo_verify(CMS_SignerInfo *si);
0397 int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
0398 BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
0399 STACK_OF(X509) *scerts, X509_STORE *store,
0400 STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls,
0401 unsigned int flags,
0402 OSSL_LIB_CTX *libctx, const char *propq);
0403
0404 int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
0405 int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
0406 int algnid, int keysize);
0407 int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
0408
0409 int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
0410 int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
0411 int lastpos);
0412 int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
0413 int lastpos);
0414 X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
0415 X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
0416 int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
0417 int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
0418 const ASN1_OBJECT *obj, int type,
0419 const void *bytes, int len);
0420 int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
0421 int nid, int type,
0422 const void *bytes, int len);
0423 int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
0424 const char *attrname, int type,
0425 const void *bytes, int len);
0426 void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
0427 const ASN1_OBJECT *oid,
0428 int lastpos, int type);
0429
0430 int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
0431 int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
0432 int lastpos);
0433 int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
0434 const ASN1_OBJECT *obj, int lastpos);
0435 X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
0436 X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
0437 int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
0438 int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
0439 const ASN1_OBJECT *obj, int type,
0440 const void *bytes, int len);
0441 int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
0442 int nid, int type,
0443 const void *bytes, int len);
0444 int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
0445 const char *attrname, int type,
0446 const void *bytes, int len);
0447 void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
0448 int lastpos, int type);
0449
0450 int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
0451 CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
0452 unsigned char *id, int idlen, int allorfirst,
0453 STACK_OF(GENERAL_NAMES) *receiptList,
0454 STACK_OF(GENERAL_NAMES) *receiptsTo);
0455 CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
0456 unsigned char *id, int idlen, int allorfirst,
0457 STACK_OF(GENERAL_NAMES) *receiptList,
0458 STACK_OF(GENERAL_NAMES) *receiptsTo,
0459 OSSL_LIB_CTX *libctx);
0460
0461 int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
0462 void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
0463 ASN1_STRING **pcid,
0464 int *pallorfirst,
0465 STACK_OF(GENERAL_NAMES) **plist,
0466 STACK_OF(GENERAL_NAMES) **prto);
0467 int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
0468 X509_ALGOR **palg,
0469 ASN1_OCTET_STRING **pukm);
0470 STACK_OF(CMS_RecipientEncryptedKey)
0471 *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
0472
0473 int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
0474 X509_ALGOR **pubalg,
0475 ASN1_BIT_STRING **pubkey,
0476 ASN1_OCTET_STRING **keyid,
0477 X509_NAME **issuer,
0478 ASN1_INTEGER **sno);
0479
0480 int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
0481
0482 int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
0483 ASN1_OCTET_STRING **keyid,
0484 ASN1_GENERALIZEDTIME **tm,
0485 CMS_OtherKeyAttribute **other,
0486 X509_NAME **issuer, ASN1_INTEGER **sno);
0487 int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
0488 X509 *cert);
0489 int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
0490 int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer);
0491 EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
0492 int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
0493 CMS_RecipientInfo *ri,
0494 CMS_RecipientEncryptedKey *rek);
0495
0496 int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
0497 ASN1_OCTET_STRING *ukm, int keylen);
0498
0499
0500 # define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
0501 # define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
0502 CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
0503
0504 # ifdef __cplusplus
0505 }
0506 # endif
0507 # endif
0508 #endif