From 50ee5183ecf96b0a4432e49765cc877c69daf77b Mon Sep 17 00:00:00 2001 From: Kevin Wooten Date: Mon, 16 Jun 2025 15:02:00 -0700 Subject: [PATCH] ASN.1 doc fixes --- .../Data Formats/ASN1/ASN1 ReadingWriting.md | 4 ++-- .../Data Formats/ASN1/ASN1 SchemaEncodingDecoding.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 ReadingWriting.md b/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 ReadingWriting.md index bf1df7e20..0da273727 100644 --- a/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 ReadingWriting.md +++ b/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 ReadingWriting.md @@ -14,7 +14,7 @@ Reading and writing ASN.1 encoded data to/from ``PotentASN1/ASN1`` tree values. ```swift import PotentASN1 -let asn1Value = ASN1Serialization.asn1(fromDER: derData) +let asn1Value = try ASN1Serialization.asn1(fromDER: derData) ``` ### Writing ASN.1 @@ -24,7 +24,7 @@ let asn1Value = ASN1Serialization.asn1(fromDER: derData) ```swift import PotentASN1 -let derData = ASN1Serialization.der(from: .sequence([.utf8String("Hello ASN.1"), .integer(5)])) +let derData = try ASN1Serialization.der(from: .sequence([.utf8String("Hello ASN.1"), .integer(5)])) print(derData.base64EncodedString()) ``` diff --git a/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 SchemaEncodingDecoding.md b/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 SchemaEncodingDecoding.md index 74cbe6726..6530da36d 100644 --- a/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 SchemaEncodingDecoding.md +++ b/Sources/PotentCodables/PotentCodables.docc/Data Formats/ASN1/ASN1 SchemaEncodingDecoding.md @@ -7,7 +7,7 @@ Use ASN.1 schemas to encode and decode to or from Swift structs and classes. ASN.1 is a position based format and lacks encoded field names for it's values; instead ASN.1 provides field names and formats via ASN.1 schema notation. -To allow mapping ASN.1 data to Swift structures and classes, ``PotentASN1/ASN1Encoder`` and ``PotentASN1/ASN1Encoder`` +To allow mapping ASN.1 data to Swift structures and classes, ``PotentASN1/ASN1Encoder`` and ``PotentASN1/ASN1Decoder`` require a provided ``PotentASN1/Schema`` to direct the encoding and/or decoding of Swift types. For example, the following is the schema for RFC-5280's `Certificate`: