1=pod
2
3=head1 NAME
4
5 CMS_get0_type, CMS_set1_eContentType, CMS_get0_eContentType - get and set CMS content types
6
7=head1 SYNOPSIS
8
9 #include <openssl/cms.h>
10
11 const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
12 int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
13 const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
14
15=head1 DESCRIPTION
16
17CMS_get0_type() returns the content type of a CMS_ContentInfo structure as
18and ASN1_OBJECT pointer. An application can then decide how to process the
19CMS_ContentInfo structure based on this value.
20
21CMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo
22structure. It should be called with CMS functions with the B<CMS_PARTIAL>
23flag and B<before> the structure is finalised, otherwise the results are
24undefined.
25
26ASN1_OBJECT *CMS_get0_eContentType() returns a pointer to the embedded
27content type.
28
29=head1 NOTES
30
31As the B<0> implies CMS_get0_type() and CMS_get0_eContentType() return internal
32pointers which should B<not> be freed up. CMS_set1_eContentType() copies the
33supplied OID and it B<should> be freed up after use.
34
35The B<ASN1_OBJECT> values returned can be converted to an integer B<NID> value
36using OBJ_obj2nid(). For the currently supported content types the following
37values are returned:
38
39 NID_pkcs7_data
40 NID_pkcs7_signed
41 NID_pkcs7_digest
42 NID_id_smime_ct_compressedData:
43 NID_pkcs7_encrypted
44 NID_pkcs7_enveloped
45
46
47=head1 RETURN VALUES
48
49CMS_get0_type() and CMS_get0_eContentType() return and ASN1_OBJECT structure.
50
51CMS_set1_eContentType() returns 1 for success or 0 if an error occurred.  The
52error can be obtained from ERR_get_error(3).
53
54=head1 SEE ALSO
55
56L<ERR_get_error(3)|ERR_get_error(3)>
57
58=head1 HISTORY
59
60CMS_get0_type(), CMS_set1_eContentType() and CMS_get0_eContentType() were all
61first added to OpenSSL 0.9.8
62
63=cut
64