---
title: Cryptographic Message Syntax Services
framework: security
role: collectionGroup
role_heading: API Collection
path: security/cryptographic-message-syntax-services
---

# Cryptographic Message Syntax Services

Cryptographically sign and encrypt S/MIME messages.

## Overview

Overview When you want to exchange data securely using the Multipurpose Internet Mail Extensions (MIME) protocol, you use the version of the protocol known as S/MIME defined in RFC 3851. This allows you to, among other things, ensure data integrity through digital signatures and data confidentiality through encryption. S/MIME in turn relies on the Cryptographic Message Syntax (CMS) protocol defined in RFC 3852 to carry out these operations. Cryptographic message syntax services provides encoder objects that perform encryption using the CMS protocol’s enveloped-data content type and sign using the signed-data content type. When a message is both signed and encrypted, the enveloped data content contains the signed data content. That is, the message is first signed and then the signed content is encrypted.

## Topics

### The Encoder

- [CMSEncoderCreate(_:)](security/cmsencodercreate(_:).md)
- [CMSEncoder](security/cmsencoder.md)
- [CMSEncoderGetTypeID()](security/cmsencodergettypeid().md)

### Message Creation

- [CMSEncoderAddSigners(_:_:)](security/cmsencoderaddsigners(_:_:).md)
- [CMSEncoderAddRecipients(_:_:)](security/cmsencoderaddrecipients(_:_:).md)
- [CMSEncoderSetHasDetachedContent(_:_:)](security/cmsencodersethasdetachedcontent(_:_:).md)
- [CMSEncoderSetEncapsulatedContentTypeOID(_:_:)](security/cmsencodersetencapsulatedcontenttypeoid(_:_:).md)
- [CMSEncoderAddSupportingCerts(_:_:)](security/cmsencoderaddsupportingcerts(_:_:).md)
- [CMSEncoderAddSignedAttributes(_:_:)](security/cmsencoderaddsignedattributes(_:_:).md)
- [CMSSignedAttributes](security/cmssignedattributes.md)
- [CMSEncoderSetCertificateChainMode(_:_:)](security/cmsencodersetcertificatechainmode(_:_:).md)
- [CMSCertificateChainMode](security/cmscertificatechainmode.md)
- [CMSEncoderSetSignerAlgorithm(_:_:)](security/cmsencodersetsigneralgorithm(_:_:).md)

### Message Characteristics

- [CMSEncoderCopySigners(_:_:)](security/cmsencodercopysigners(_:_:).md)
- [CMSEncoderCopyRecipients(_:_:)](security/cmsencodercopyrecipients(_:_:).md)
- [CMSEncoderGetHasDetachedContent(_:_:)](security/cmsencodergethasdetachedcontent(_:_:).md)
- [CMSEncoderCopyEncapsulatedContentType(_:_:)](security/cmsencodercopyencapsulatedcontenttype(_:_:).md)
- [CMSEncoderCopySupportingCerts(_:_:)](security/cmsencodercopysupportingcerts(_:_:).md)
- [CMSEncoderGetCertificateChainMode(_:_:)](security/cmsencodergetcertificatechainmode(_:_:).md)

### Encoding

- [CMSEncoderUpdateContent(_:_:_:)](security/cmsencoderupdatecontent(_:_:_:).md)
- [CMSEncoderCopyEncodedContent(_:_:)](security/cmsencodercopyencodedcontent(_:_:).md)
- [CMSEncodeContent(_:_:_:_:_:_:_:_:)](security/cmsencodecontent(_:_:_:_:_:_:_:_:).md)

### The Decoder

- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
- [CMSDecoder](security/cmsdecoder.md)
- [CMSDecoderGetTypeID()](security/cmsdecodergettypeid().md)

### Decoding

- [CMSDecoderUpdateMessage(_:_:_:)](security/cmsdecoderupdatemessage(_:_:_:).md)
- [CMSDecoderFinalizeMessage(_:)](security/cmsdecoderfinalizemessage(_:).md)
- [CMSDecoderSetDetachedContent(_:_:)](security/cmsdecodersetdetachedcontent(_:_:).md)
- [CMSDecoderCopyDetachedContent(_:_:)](security/cmsdecodercopydetachedcontent(_:_:).md)

### Signature Verification

- [CMSDecoderSetSearchKeychain(_:_:)](security/cmsdecodersetsearchkeychain(_:_:).md)
- [CMSDecoderGetNumSigners(_:_:)](security/cmsdecodergetnumsigners(_:_:).md)
- [CMSDecoderCopySignerEmailAddress(_:_:_:)](security/cmsdecodercopysigneremailaddress(_:_:_:).md)
- [CMSDecoderCopySignerCert(_:_:_:)](security/cmsdecodercopysignercert(_:_:_:).md)
- [CMSDecoderCopySignerStatus(_:_:_:_:_:_:_:)](security/cmsdecodercopysignerstatus(_:_:_:_:_:_:_:).md)
- [CMSSignerStatus](security/cmssignerstatus.md)

### Message Content

- [CMSDecoderIsContentEncrypted(_:_:)](security/cmsdecoderiscontentencrypted(_:_:).md)
- [CMSDecoderCopyEncapsulatedContentType(_:_:)](security/cmsdecodercopyencapsulatedcontenttype(_:_:).md)
- [CMSDecoderCopyAllCerts(_:_:)](security/cmsdecodercopyallcerts(_:_:).md)
- [CMSDecoderCopyContent(_:_:)](security/cmsdecodercopycontent(_:_:).md)

### Timestamps

- [CMSDecoderCopySignerSigningTime(_:_:_:)](security/cmsdecodercopysignersigningtime(_:_:_:).md)
- [CMSDecoderCopySignerTimestamp(_:_:_:)](security/cmsdecodercopysignertimestamp(_:_:_:).md)
- [CMSDecoderCopySignerTimestampCertificates(_:_:_:)](security/cmsdecodercopysignertimestampcertificates(_:_:_:).md)
- [CMSDecoderCopySignerTimestampWithPolicy(_:_:_:_:)](security/cmsdecodercopysignertimestampwithpolicy(_:_:_:_:).md)
- [CMSEncoderCopySignerTimestamp(_:_:_:)](security/cmsencodercopysignertimestamp(_:_:_:).md)
- [CMSEncoderCopySignerTimestampWithPolicy(_:_:_:_:)](security/cmsencodercopysignertimestampwithpolicy(_:_:_:_:).md)
