Encode and decode Distinguished Encoding Rules (DER) and Basic Encoding Rules (BER) data streams.


You use an ASN.1 coder to encode and decode both DER and BER data streams based on templates that you supply, which in turn are based upon ASN.1 specifications. You must import this API explicitly:

import Security.SecAsn1Coder
import Security.SecAsn1Templates



typealias SecAsn1Item

A structure holding DER encoded data.

typealias SecAsn1Template

A structure that defines one element of a BER or DER encoding.

typealias SecAsn1TemplateChooser

Dynamically provides the sub-template to use during encode or decode.

typealias SecAsn1TemplateChooserPtr

A pointer to the template chooser function.

Type Tags

Recognize BER and DER values for ASN.1 identifier octets.

OID Comparison

typealias SecAsn1Oid

An object identifier.

Public Key Info

struct SecAsn1AlgId

A structure identifying an ASN.1 algorithm by its OID, and its corresponding parameters.

struct SecAsn1PubKeyInfo

A structure containing a public key and its associated algorithm.

See Also


Complying with Encryption Export Regulations

Declare the use of encryption in your app to streamline the app submission process.

Certificate, Key, and Trust Services

Establish trust using certificates and cryptographic keys.

Cryptographic Message Syntax Services

Cryptographically sign and encrypt S/MIME messages.

Randomization Services

Generate cryptographically secure random numbers.

Security Transforms

Perform cryptographic functions like encoding, encryption, signing, and signature verification.