CMS_get0_type.3 revision 340704
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\}
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "CMS_get0_type 3"
CMS_get0_type 3 "2018-11-20" "1.0.2q" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
.Vb 1 CMS_get0_type, CMS_set1_eContentType, CMS_get0_eContentType, CMS_get0_content - get and set CMS content types and content .Ve
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/cms.h> \& const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); .Ve
"DESCRIPTION"
Header "DESCRIPTION" \fICMS_get0_type() returns the content type of a CMS_ContentInfo structure as and \s-1ASN1_OBJECT\s0 pointer. An application can then decide how to process the CMS_ContentInfo structure based on this value.

\fICMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo structure. It should be called with \s-1CMS\s0 functions with the \s-1CMS_PARTIAL\s0 flag and before the structure is finalised, otherwise the results are undefined.

\s-1ASN1_OBJECT\s0 *CMS_get0_eContentType() returns a pointer to the embedded content type.

\fICMS_get0_content() returns a pointer to the \s-1ASN1_OCTET_STRING\s0 pointer containing the embedded content.

"NOTES"
Header "NOTES" As the 0 implies CMS_get0_type(), CMS_get0_eContentType() and \fICMS_get0_content() return internal pointers which should not be freed up. \fICMS_set1_eContentType() copies the supplied \s-1OID\s0 and it should be freed up after use.

The \s-1ASN1_OBJECT\s0 values returned can be converted to an integer \s-1NID\s0 value using OBJ_obj2nid(). For the currently supported content types the following values are returned:

.Vb 6 NID_pkcs7_data NID_pkcs7_signed NID_pkcs7_digest NID_id_smime_ct_compressedData: NID_pkcs7_encrypted NID_pkcs7_enveloped .Ve

The return value of CMS_get0_content() is a pointer to the \s-1ASN1_OCTET_STRING\s0 content pointer. That means that for example:

.Vb 1 ASN1_OCTET_STRING **pconf = CMS_get0_content(cms); .Ve

\fB*pconf could be \s-1NULL\s0 if there is no embedded content. Applications can access, modify or create the embedded content in a CMS_ContentInfo structure using this function. Applications usually will not need to modify the embedded content as it is normally set by higher level functions.

"RETURN VALUES"
Header "RETURN VALUES" \fICMS_get0_type() and CMS_get0_eContentType() return and \s-1ASN1_OBJECT\s0 structure.

\fICMS_set1_eContentType() returns 1 for success or 0 if an error occurred. The error can be obtained from ERR_get_error\|(3).

"SEE ALSO"
Header "SEE ALSO" \fIERR_get_error\|(3)
"HISTORY"
Header "HISTORY" \fICMS_get0_type(), CMS_set1_eContentType() and CMS_get0_eContentType() were all first added to OpenSSL 0.9.8