Improve EVP_PKEY_sign documentation
[openssl.git] / doc / crypto / CMS_get0_type.pod
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
17 CMS_get0_type() returns the content type of a CMS_ContentInfo structure as
18 and ASN1_OBJECT pointer. An application can then decide how to process the
19 CMS_ContentInfo structure based on this value.
20
21 CMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo
22 structure. It should be called with CMS functions with the B<CMS_PARTIAL>
23 flag and B<before> the structure is finalised, otherwise the results are
24 undefined.
25
26 ASN1_OBJECT *CMS_get0_eContentType() returns a pointer to the embedded
27 content type.
28
29 =head1 NOTES
30
31 As the B<0> implies CMS_get0_type() and CMS_get0_eContentType() return internal
32 pointers which should B<not> be freed up. CMS_set1_eContentType() copies the
33 supplied OID and it B<should> be freed up after use.
34
35 The B<ASN1_OBJECT> values returned can be converted to an integer B<NID> value
36 using OBJ_obj2nid(). For the currently supported content types the following
37 values 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
49 CMS_get0_type() and CMS_get0_eContentType() return and ASN1_OBJECT structure.
50
51 CMS_set1_eContentType() returns 1 for success or 0 if an error occurred.  The
52 error can be obtained from ERR_get_error(3).
53
54 =head1 SEE ALSO
55
56 L<ERR_get_error(3)|ERR_get_error(3)>
57
58 =head1 HISTORY
59
60 CMS_get0_type(), CMS_set1_eContentType() and CMS_get0_eContentType() were all
61 first added to OpenSSL 0.9.8
62
63 =cut