diff --git a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj
index f8e68ec8d9a30..445fa72447844 100644
--- a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj
+++ b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj
@@ -4,7 +4,6 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
$(DefineConstants);CP_NO_ZEROMEMORY
- false
true
Provides classes that can read and write the ASN.1 BER, CER, and DER data formats.
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/Asn1Tag.Accelerators.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/Asn1Tag.Accelerators.cs
index d222622b88a88..11261c6b67a0f 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/Asn1Tag.Accelerators.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/Asn1Tag.Accelerators.cs
@@ -43,7 +43,7 @@ public partial struct Asn1Tag
new Asn1Tag(ConstructedMask, (int)UniversalTagNumber.OctetString);
///
- /// Represents the universal class tag for a Null value.
+ /// Represents the universal class tag for a Null value.
///
public static readonly Asn1Tag Null = new Asn1Tag(0, (int)UniversalTagNumber.Null);
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnContentException.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnContentException.cs
index 4bbee61211e78..782c86ea76673 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnContentException.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnContentException.cs
@@ -6,24 +6,55 @@
namespace System.Formats.Asn1
{
+ ///
+ /// The exception that is thrown when an encoded ASN.1 value cannot be successfully decoded.
+ ///
[Serializable]
public class AsnContentException : Exception
{
+ ///
+ /// Initializes a new instance of the class, using the default message.
+ ///
public AsnContentException()
: base(SR.ContentException_DefaultMessage)
{
}
+ ///
+ /// Initializes a new instance of the class, using the provided message.
+ ///
+ ///
+ /// The error message that explains the reason for the exception.
+ ///
public AsnContentException(string? message)
: base(message ?? SR.ContentException_DefaultMessage)
{
}
+ ///
+ /// Initializes a new instance of the class, using the provided message and
+ /// exception that is the cause of this exception.
+ ///
+ ///
+ /// The error message that explains the reason for the exception.
+ ///
+ ///
+ /// The exception that is the cause of the current exception.
+ ///
public AsnContentException(string? message, Exception? inner)
: base(message ?? SR.ContentException_DefaultMessage, inner)
{
}
+ ///
+ /// Initializes a new instance of the class with serialized data.
+ ///
+ ///
+ /// The object that holds the serialized object data.
+ ///
+ ///
+ /// The contextual information about the source or destination.
+ ///
#if NET8_0_OR_GREATER
[Obsolete(Obsoletions.LegacyFormatterImplMessage, DiagnosticId = Obsoletions.LegacyFormatterImplDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.BitString.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.BitString.cs
index f1914c6db9dae..b803a5d18fd55 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.BitString.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.BitString.cs
@@ -41,15 +41,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -122,24 +122,19 @@ public static bool TryReadPrimitiveBitString(
/// value of the Bit String;
/// otherwise, .
///
- ///
- /// The least significant bits in the last byte which are reported as "unused" by the
- /// value will be copied into
- /// as unset bits, irrespective of their value in the encoded representation.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -151,6 +146,11 @@ public static bool TryReadPrimitiveBitString(
///
/// overlaps .
///
+ ///
+ /// The least significant bits in the last byte that are reported as "unused" by the
+ /// value will be copied into
+ /// as unset bits, irrespective of their value in the encoded representation.
+ ///
///
///
public static bool TryReadBitString(
@@ -244,24 +244,19 @@ public static bool TryReadBitString(
///
/// An array containing the contents of the Bit String value.
///
- ///
- /// The least significant bits in the last byte which are reported as "unused" by the
- /// value will be copied into the return value
- /// as unset bits, irrespective of their value in the encoded representation.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -269,6 +264,11 @@ public static bool TryReadBitString(
/// . is not correct for
/// the method.
///
+ ///
+ /// The least significant bits in the last byte that are reported as "unused" by the
+ /// value will be copied into the return value
+ /// as unset bits, irrespective of their value in the encoded representation.
+ ///
///
///
public static byte[] ReadBitString(
@@ -696,15 +696,15 @@ public partial class AsnReader
/// and does not advance the reader if it had a constructed encoding.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -760,15 +760,15 @@ public bool TryReadPrimitiveBitString(
/// and the reader does not advance.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -816,15 +816,15 @@ public bool TryReadBitString(
/// A copy of the value in a newly allocated, precisely sized, array.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Boolean.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Boolean.cs
index 838b2195e5c6c..e071df17cd86a 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Boolean.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Boolean.cs
@@ -25,15 +25,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -93,15 +93,15 @@ public partial class AsnReader
/// The decoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Enumerated.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Enumerated.cs
index 04435e147aedf..5583713ed1662 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Enumerated.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Enumerated.cs
@@ -29,15 +29,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -64,6 +64,7 @@ public static ReadOnlySpan ReadEnumeratedBytes(
/// the specified encoding rules, converting it to the
/// non-[] enum specified by .
///
+ /// The destination enum type.
/// The buffer containing encoded data.
/// The encoding constraints to use when interpreting the data.
///
@@ -73,31 +74,26 @@ public static ReadOnlySpan ReadEnumeratedBytes(
///
/// The tag to check for before reading, or for the default tag (Universal 10).
///
- /// Destination enum type
///
/// The Enumerated value converted to a .
///
- ///
- /// This method does not validate that the return value is defined within
- /// .
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -113,6 +109,10 @@ public static ReadOnlySpan ReadEnumeratedBytes(
/// . is not correct for
/// the method.
///
+ ///
+ /// This method does not validate that the return value is defined within
+ /// .
+ ///
public static TEnum ReadEnumeratedValue(
ReadOnlySpan source,
AsnEncodingRules ruleSet,
@@ -150,24 +150,20 @@ public static TEnum ReadEnumeratedValue(
///
/// The Enumerated value converted to a .
///
- ///
- /// This method does not validate that the return value is defined within
- /// .
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -186,6 +182,10 @@ public static TEnum ReadEnumeratedValue(
///
/// is .
///
+ ///
+ /// This method does not validate that the return value is defined within
+ /// .
+ ///
public static Enum ReadEnumeratedValue(
ReadOnlySpan source,
AsnEncodingRules ruleSet,
@@ -275,15 +275,15 @@ public partial class AsnReader
/// The bytes of the Enumerated value, in signed big-endian form.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -307,31 +307,27 @@ public ReadOnlyMemory ReadEnumeratedBytes(Asn1Tag? expectedTag = null)
/// Reads the next value as an Enumerated with a specified tag, converting it to the
/// non-[] enum specified by .
///
+ /// The destination enum type.
///
/// The tag to check for before reading, or for the default tag (Universal 10).
///
- /// Destination enum type
///
/// The Enumerated value converted to a .
///
- ///
- /// This method does not validate that the return value is defined within
- /// .
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -347,6 +343,10 @@ public ReadOnlyMemory ReadEnumeratedBytes(Asn1Tag? expectedTag = null)
/// . is not correct for
/// the method.
///
+ ///
+ /// This method does not validate that the return value is defined within
+ /// .
+ ///
public TEnum ReadEnumeratedValue(Asn1Tag? expectedTag = null) where TEnum : Enum
{
TEnum ret = AsnDecoder.ReadEnumeratedValue(_data.Span, RuleSet, out int consumed, expectedTag);
@@ -365,24 +365,20 @@ public TEnum ReadEnumeratedValue(Asn1Tag? expectedTag = null) where TEnum
///
/// The Enumerated value converted to a .
///
- ///
- /// This method does not validate that the return value is defined within
- /// .
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -401,6 +397,10 @@ public TEnum ReadEnumeratedValue(Asn1Tag? expectedTag = null) where TEnum
///
/// is .
///
+ ///
+ /// This method does not validate that the return value is defined within
+ /// .
+ ///
public Enum ReadEnumeratedValue(Type enumType, Asn1Tag? expectedTag = null)
{
Enum ret = AsnDecoder.ReadEnumeratedValue(_data.Span, RuleSet, enumType, out int consumed, expectedTag);
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs
index 9acf1d591d9a4..09f9df7eca288 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs
@@ -29,15 +29,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -412,15 +412,15 @@ public partial class AsnReader
/// The decoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Integer.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Integer.cs
index 35372824d35e2..5d59ba14977cb 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Integer.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Integer.cs
@@ -30,15 +30,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -80,15 +80,15 @@ public static ReadOnlySpan ReadIntegerBytes(
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -151,22 +151,22 @@ public static BigInteger ReadInteger(
///
///
/// if the Integer represents value is between
- /// and , inclusive; otherwise,
+ /// Int32.MinValue and Int32.MaxValue, inclusive; otherwise,
/// .
///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -217,22 +217,22 @@ public static bool TryReadInt32(
///
///
/// if the Integer represents value is between
- /// and , inclusive; otherwise,
+ /// UInt32.MinValue and UInt32.MaxValue, inclusive; otherwise,
/// .
///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -284,22 +284,22 @@ public static bool TryReadUInt32(
///
///
/// if the Integer represents value is between
- /// and , inclusive; otherwise,
+ /// Int64.MinValue and Int64.MaxValue, inclusive; otherwise,
/// .
///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -343,22 +343,22 @@ public static bool TryReadInt64(
///
///
/// if the Integer represents value is between
- /// and , inclusive; otherwise,
+ /// UInt64.MinValue and UInt64.MaxValue, inclusive; otherwise,
/// .
///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -528,15 +528,15 @@ public partial class AsnReader
/// The bytes of the Integer value, in signed big-endian form.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -565,15 +565,15 @@ public ReadOnlyMemory ReadIntegerBytes(Asn1Tag? expectedTag = null)
/// The decoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -600,19 +600,19 @@ public BigInteger ReadInteger(Asn1Tag? expectedTag = null)
///
///
/// and does not advance the reader if the value is not between
- /// and , inclusive; otherwise
+ /// Int32.MinValue and Int32.MaxValue, inclusive; otherwise
/// is returned and the reader advances.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -639,19 +639,19 @@ public bool TryReadInt32(out int value, Asn1Tag? expectedTag = null)
///
///
/// and does not advance the reader if the value is not between
- /// and , inclusive; otherwise
+ /// UInt32.MinValue and UInt32.MaxValue, inclusive; otherwise
/// is returned and the reader advances.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -679,19 +679,19 @@ public bool TryReadUInt32(out uint value, Asn1Tag? expectedTag = null)
///
///
/// and does not advance the reader if the value is not between
- /// and , inclusive; otherwise
+ /// Int64.MinValue and Int64.MaxValue, inclusive; otherwise
/// is returned and the reader advances.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -718,19 +718,19 @@ public bool TryReadInt64(out long value, Asn1Tag? expectedTag = null)
///
///
/// and does not advance the reader if the value is not between
- /// and , inclusive; otherwise
+ /// Int64.MinValue and Int64.MaxValue, inclusive; otherwise
/// is returned and the reader advances.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs
index 03e820dc474a1..be5431e266f0b 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs
@@ -15,6 +15,7 @@ public static partial class AsnDecoder
/// the specified encoding rules, converting it to the
/// [] enum specified by .
///
+ /// The destination enum type.
/// The buffer containing encoded data.
/// The encoding constraints to use when interpreting the data.
///
@@ -24,7 +25,6 @@ public static partial class AsnDecoder
///
/// The tag to check for before reading, or for the default tag (Universal 3).
///
- /// Destination enum type
///
/// The NamedBitList value converted to a .
///
@@ -32,19 +32,19 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -97,9 +97,9 @@ public static partial class AsnDecoder
/// }
///
///
- /// Note that while the example here uses the KeyUsage NamedBitList from
+ /// While the example here uses the KeyUsage NamedBitList from
/// RFC 3280 (4.2.1.3),
- /// the example enum uses values thar are different from
+ /// the example enum uses values that are different from
/// System.Security.Cryptography.X509Certificates.X509KeyUsageFlags.
///
public static TFlagsEnum ReadNamedBitListValue(
@@ -142,19 +142,19 @@ public static TFlagsEnum ReadNamedBitListValue(
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///-
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -294,15 +294,15 @@ public static Enum ReadNamedBitListValue(
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -405,25 +405,25 @@ public partial class AsnReader
/// Reads the next value as a NamedBitList with a specified tag, converting it to the
/// [] enum specified by .
///
+ /// The destination enum type.
/// The tag to check for before reading.
- /// Destination enum type
///
/// The NamedBitList value converted to a .
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -476,9 +476,9 @@ public partial class AsnReader
/// }
///
///
- /// Note that while the example here uses the KeyUsage NamedBitList from
+ /// While the example here uses the KeyUsage NamedBitList from
/// RFC 3280 (4.2.1.3),
- /// the example enum uses values thar are different from
+ /// the example enum uses values that are different from
/// System.Security.Cryptography.X509Certificates.X509KeyUsageFlags.
///
public TFlagsEnum ReadNamedBitListValue(Asn1Tag? expectedTag = null) where TFlagsEnum : Enum
@@ -497,25 +497,25 @@ public TFlagsEnum ReadNamedBitListValue(Asn1Tag? expectedTag = null)
/// Reads the next value as a NamedBitList with a specified tag, converting it to the
/// [] enum specified by .
///
- /// The tag to check for before reading.
/// Type object representing the destination type.
+ /// The tag to check for before reading.
///
/// The NamedBitList value converted to a .
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the encoded value is too big to fit in a value.
+ /// The encoded value is too big to fit in a value.
///
///
/// is not an enum type.
@@ -556,15 +556,15 @@ public Enum ReadNamedBitListValue(Type flagsEnumType, Asn1Tag? expectedTag = nul
/// The bits from the encoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Null.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Null.cs
index 776ee88e57e46..24fb908824991 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Null.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Null.cs
@@ -22,15 +22,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -71,15 +71,15 @@ public partial class AsnReader
/// The tag to check for before reading, or for the default tag (Universal 5).
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.OctetString.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.OctetString.cs
index 19dc0e179f80c..7fccc36782bdc 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.OctetString.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.OctetString.cs
@@ -36,15 +36,15 @@ public static partial class AsnDecoder
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -136,15 +136,15 @@ public static bool TryReadOctetString(
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -247,15 +247,15 @@ private static bool TryReadPrimitiveOctetStringCore(
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -551,15 +551,15 @@ public partial class AsnReader
/// and the reader does not advance.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -601,15 +601,15 @@ public bool TryReadOctetString(
/// A copy of the value in a newly allocated, precisely sized, array.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -630,25 +630,25 @@ public byte[] ReadOctetString(Asn1Tag? expectedTag = null)
/// Attempts to read the next value as an OCTET STRING with a specified tag, returning the contents
/// as a over the original data.
///
- /// The tag to check for before reading.
///
/// On success, receives a over the original data
/// corresponding to the value of the OCTET STRING.
///
+ /// The tag to check for before reading.
///
/// and advances the reader if the OCTET STRING value had a primitive encoding,
/// and does not advance the reader if it had a constructed encoding.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs
index 31be255b74be8..f471cc8f5b96b 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs
@@ -25,21 +25,21 @@ public static partial class AsnDecoder
/// The tag to check for before reading, or for the default tag (Universal 6).
///
///
- /// The decoded object identifier, in dotted-decimal notation.
+ /// The decoded object identifier in the dotted-decimal notation.
///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -345,16 +345,17 @@ public partial class AsnReader
///
/// The tag to check for before reading, or for the default tag (Universal 6).
///
+ /// The decoded object identifier in the dotted-decimal notation.
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Sequence.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Sequence.cs
index 00b7aac675333..f66ffcb85ad1a 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Sequence.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Sequence.cs
@@ -27,24 +27,19 @@ public static partial class AsnDecoder
///
/// The tag to check for before reading, or for the default tag (Universal 16).
///
- ///
- /// The nested content is not evaluated by this method, except for minimal processing to
- /// determine the location of an end-of-contents marker.
- /// Therefore, the contents may contain data which is not valid under the current encoding rules.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -52,6 +47,11 @@ public static partial class AsnDecoder
/// . is not correct for
/// the method.
///
+ ///
+ /// The nested content is not evaluated by this method, except for minimal processing to
+ /// determine the location of an end-of-contents marker.
+ /// Therefore, the contents might contain data that's not valid under the current encoding rules.
+ ///
public static void ReadSequence(
ReadOnlySpan source,
AsnEncodingRules ruleSet,
@@ -109,20 +109,16 @@ public partial class AsnReader
/// A new reader positioned at the first
/// value in the sequence (or with == ).
///
- ///
- /// the nested content is not evaluated by this method, and may contain data
- /// which is not valid under the current encoding rules.
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -130,6 +126,10 @@ public partial class AsnReader
/// . is not correct for
/// the method.
///
+ ///
+ /// The nested content is not evaluated by this method, and might contain data
+ /// that's not valid under the current encoding rules.
+ ///
public AsnReader ReadSequence(Asn1Tag? expectedTag = null)
{
AsnDecoder.ReadSequence(
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.SetOf.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.SetOf.cs
index 826d1cff27145..34f9c7da9fea7 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.SetOf.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.SetOf.cs
@@ -32,25 +32,19 @@ public static partial class AsnDecoder
///
/// The tag to check for before reading, or for the default tag (Universal 17).
///
- ///
- /// The nested content is not evaluated by this method, except for minimal processing to
- /// determine the location of an end-of-contents marker or verification of the content
- /// sort order.
- /// Therefore, the contents may contain data which is not valid under the current encoding rules.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -58,6 +52,12 @@ public static partial class AsnDecoder
/// . is not correct for
/// the method.
///
+ ///
+ /// The nested content is not evaluated by this method, except for minimal processing to
+ /// determine the location of an end-of-contents marker or verification of the content
+ /// sort order.
+ /// Therefore, the contents might contain data that's not valid under the current encoding rules.
+ ///
public static void ReadSetOf(
ReadOnlySpan source,
AsnEncodingRules ruleSet,
@@ -143,20 +143,16 @@ public partial class AsnReader
/// A new reader positioned at the first
/// value in the set-of (or with == ).
///
- ///
- /// the nested content is not evaluated by this method (aside from sort order, when
- /// required), and may contain data which is not valid under the current encoding rules.
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -164,6 +160,10 @@ public partial class AsnReader
/// . is not correct for
/// the method.
///
+ ///
+ /// The nested content is not evaluated by this method (aside from sort order, when
+ /// required) and might contain data that's not valid under the current encoding rules.
+ ///
public AsnReader ReadSetOf(Asn1Tag? expectedTag = null)
{
return ReadSetOf(_options.SkipSetSortOrderVerification, expectedTag);
@@ -186,20 +186,16 @@ public AsnReader ReadSetOf(Asn1Tag? expectedTag = null)
/// A new reader positioned at the first
/// value in the set-of (or with == ).
///
- ///
- /// the nested content is not evaluated by this method (aside from sort order, when
- /// required), and may contain data which is not valid under the current encoding rules.
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -207,6 +203,10 @@ public AsnReader ReadSetOf(Asn1Tag? expectedTag = null)
/// . is not correct for
/// the method.
///
+ ///
+ /// The nested content is not evaluated by this method (aside from sort order, when
+ /// required) and might contain data that's not valid under the current encoding rules.
+ ///
public AsnReader ReadSetOf(bool skipSortOrderValidation, Asn1Tag? expectedTag = null)
{
AsnDecoder.ReadSetOf(
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Text.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Text.cs
index a30c1ca9b3592..3f65857b99736 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Text.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Text.cs
@@ -33,22 +33,19 @@ public static partial class AsnDecoder
/// if the character string value has a primitive encoding;
/// otherwise, .
///
- ///
- /// This method does not determine if the string used only characters defined by the encoding.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -56,6 +53,9 @@ public static partial class AsnDecoder
/// . is not a character
/// string tag type.
///
+ ///
+ /// This method does not determine if the string used only characters defined by the encoding.
+ ///
///
public static bool TryReadPrimitiveCharacterStringBytes(
ReadOnlySpan source,
@@ -112,22 +112,19 @@ public static bool TryReadPrimitiveCharacterStringBytes(
/// value of the unprocessed character string;
/// otherwise, .
///
- ///
- /// This method does not determine if the string used only characters defined by the encoding.
- ///
///
/// is not defined.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -139,6 +136,9 @@ public static bool TryReadPrimitiveCharacterStringBytes(
///
/// overlaps .
///
+ ///
+ /// This method does not determine if the string used only characters defined by the encoding.
+ ///
///
///
///
@@ -217,19 +217,19 @@ public static bool TryReadCharacterStringBytes(
/// is not a known character string type.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the string did not successfully decode.
+ /// The string did not successfully decode.
///
///
/// . is
@@ -289,19 +289,19 @@ public static bool TryReadCharacterString(
/// is not a known character string type.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the string did not successfully decode.
+ /// The string did not successfully decode.
///
///
/// . is
@@ -561,19 +561,16 @@ public partial class AsnReader
/// and advances the reader if the character string value had a primitive encoding,
/// and does not advance the reader if it had a constructed encoding.
///
- ///
- /// This method does not determine if the string used only characters defined by the encoding.
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -581,6 +578,9 @@ public partial class AsnReader
/// . is not a character
/// string tag type.
///
+ ///
+ /// This method does not determine if the string used only characters defined by the encoding.
+ ///
///
public bool TryReadPrimitiveCharacterStringBytes(
Asn1Tag expectedTag,
@@ -620,19 +620,16 @@ public bool TryReadPrimitiveCharacterStringBytes(
/// length to receive the value, otherwise
/// and the reader does not advance.
///
- ///
- /// This method does not determine if the string used only characters defined by the encoding.
- ///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -640,6 +637,9 @@ public bool TryReadPrimitiveCharacterStringBytes(
/// . is not a character
/// string tag type.
///
+ ///
+ /// This method does not determine if the string used only characters defined by the encoding.
+ ///
///
///
///
@@ -668,10 +668,10 @@ public bool TryReadCharacterStringBytes(
/// Reads the next value as character string with the specified tag and
/// encoding type, copying the decoded value into a provided destination buffer.
///
+ /// The buffer in which to write.
///
/// One of the enumeration values representing the value type to process.
///
- /// The buffer in which to write.
///
/// On success, receives the number of chars written to .
///
@@ -688,19 +688,19 @@ public bool TryReadCharacterStringBytes(
/// is not a known character string type.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the string did not successfully decode.
+ /// The string did not successfully decode.
///
///
/// . is
@@ -748,19 +748,19 @@ public bool TryReadCharacterString(
/// is not a known character string type.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
/// -or-
///
- /// the string did not successfully decode.
+ /// The string did not successfully decode.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs
index f7fa3c656646a..f22284799a339 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs
@@ -36,15 +36,15 @@ public static partial class AsnDecoder
/// is not in the range [99, 9999].
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -252,15 +252,15 @@ public partial class AsnReader
/// The decoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
@@ -295,15 +295,15 @@ public DateTimeOffset ReadUtcTime(Asn1Tag? expectedTag = null)
/// The decoded value.
///
///
- /// the next value does not have the correct tag.
+ /// The next value does not have the correct tag.
///
/// -or-
///
- /// the length encoding is not valid under the current encoding rules.
+ /// The length encoding is not valid under the current encoding rules.
///
/// -or-
///
- /// the contents are not valid under the current encoding rules.
+ /// The contents are not valid under the current encoding rules.
///
///
/// . is
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.cs
index 28e55b114beca..ef3192de9d350 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.cs
@@ -7,7 +7,7 @@
namespace System.Formats.Asn1
{
///
- /// Provides stateless methods for decoding BER-, CER-, or DER-encoded ASN.1 data.
+ /// Provides stateless methods for decoding BER-encoded, CER-encoded, and DER-encoded ASN.1 data.
///
public static partial class AsnDecoder
{
@@ -213,7 +213,7 @@ private static ReadOnlySpan GetPrimitiveContentSpan(
/// The buffer containing encoded data.
/// The encoding constraints to use when interpreting the data.
///
- /// When this method returns, the number of bytes from the beginning of
+ /// When this method returns, contains the number of bytes from the beginning of
/// that contributed to the length.
/// This parameter is treated as uninitialized.
///
@@ -251,12 +251,12 @@ private static ReadOnlySpan GetPrimitiveContentSpan(
/// The buffer containing encoded data.
/// The encoding constraints to use when interpreting the data.
///
- /// When this method returns, the decoded value of the length, or if the
+ /// When this method returns, contains the decoded value of the length, or if the
/// encoded length represents the indefinite length.
/// This parameter is treated as uninitialized.
///
///
- /// When this method returns, the number of bytes from the beginning of
+ /// When this method returns, contains the number of bytes from the beginning of
/// that contributed to the length.
/// This parameter is treated as uninitialized.
///
@@ -778,16 +778,16 @@ public partial class AsnReader
/// The data to read.
/// The encoding constraints for the reader.
/// Additional options for the reader.
+ ///
+ /// is not defined.
+ ///
///
- /// This constructor does not evaluate for correctness,
- /// any correctness checks are done as part of member methods.
+ /// This constructor does not evaluate for correctness.
+ /// Any correctness checks are done as part of member methods.
///
/// This constructor does not copy . The caller is responsible for
/// ensuring that the values do not change until the reader is finished.
///
- ///
- /// is not defined.
- ///
public AsnReader(ReadOnlyMemory data, AsnEncodingRules ruleSet, AsnReaderOptions options = default)
{
AsnDecoder.CheckEncodingRules(ruleSet);
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnEncodingRules.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnEncodingRules.cs
index 419cdfdd37d43..e877e084b8e7a 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnEncodingRules.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnEncodingRules.cs
@@ -10,17 +10,17 @@ namespace System.Formats.Asn1
public enum AsnEncodingRules
{
///
- /// ITU-T X.690 Basic Encoding Rules
+ /// ITU-T X.690 Basic Encoding Rules.
///
BER,
///
- /// ITU-T X.690 Canonical Encoding Rules
+ /// ITU-T X.690 Canonical Encoding Rules.
///
CER,
///
- /// ITU-T X.690 Distinguished Encoding Rules
+ /// ITU-T X.690 Distinguished Encoding Rules.
///
DER,
}
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Boolean.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Boolean.cs
index e7ada3651f036..a598f9d39e764 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Boolean.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Boolean.cs
@@ -16,7 +16,7 @@ public sealed partial class AsnWriter
/// . is
/// , but
/// . is not correct for
- /// the method
+ /// the method.
///
public void WriteBoolean(bool value, Asn1Tag? tag = null)
{
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Enumerated.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Enumerated.cs
index 6c8a9a016468c..230375dc544d2 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Enumerated.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Enumerated.cs
@@ -44,8 +44,8 @@ public void WriteEnumeratedValue(Enum value, Asn1Tag? tag = null)
/// Write a non-[] enum value as an Enumerated with
/// tag UNIVERSAL 10.
///
- /// The tag to write.
/// The boxed enumeration value to write.
+ /// The tag to write.
///
/// is .
///
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Integer.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Integer.cs
index b1720b5106b2c..d499a11576de5 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Integer.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.Integer.cs
@@ -76,11 +76,11 @@ public void WriteInteger(BigInteger value, Asn1Tag? tag = null)
/// the method.
///
///
- /// the 9 most significant bits are all set.
+ /// The 9 most significant bits are all set.
///
/// -or-
///
- /// the 9 most significant bits are all unset.
+ /// The 9 most significant bits are all unset.
///
public void WriteInteger(ReadOnlySpan value, Asn1Tag? tag = null)
{
@@ -101,7 +101,7 @@ public void WriteInteger(ReadOnlySpan value, Asn1Tag? tag = null)
/// the method.
///
///
- /// the 9 most significant bits are all unset.
+ /// The 9 most significant bits are all unset.
///
public void WriteIntegerUnsigned(ReadOnlySpan value, Asn1Tag? tag = null)
{
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs
index d0c60d5d2b310..1a84098fdb50b 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs
@@ -48,6 +48,9 @@ public void WriteNamedBitList(Enum value, Asn1Tag? tag = null)
/// Write a [] enum value as a NamedBitList with
/// a specified tag.
///
+ ///
+ /// The [] enumeration type to write.
+ ///
/// The enumeration value to write
/// The tag to write, or for the default tag (Universal 3).
///
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.OctetString.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.OctetString.cs
index 60cd0629050a5..6da202199c802 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.OctetString.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.OctetString.cs
@@ -10,6 +10,7 @@ public sealed partial class AsnWriter
///
/// Begin writing an Octet String value with a specified tag.
///
+ /// The tag to write, or for the default tag (Universal 4).
///
/// A disposable value which will automatically call .
///
@@ -22,7 +23,6 @@ public sealed partial class AsnWriter
/// This method does not necessarily create a Constructed encoding, and it is not invalid to
/// write values other than Octet String inside this Push/Pop.
///
- /// The tag to write, or for the default tag (Universal 4).
///
public Scope PushOctetString(Asn1Tag? tag = null)
{
@@ -38,12 +38,6 @@ public Scope PushOctetString(Asn1Tag? tag = null)
/// returning the writer to the parent context.
///
/// The tag to write, or for the default tag (Universal 4).
- ///
- /// In and modes
- /// the encoded contents will remain in a single primitive Octet String.
- /// In mode the contents will be broken up into
- /// multiple segments, when required.
- ///
///
/// . is
/// , but
@@ -53,6 +47,12 @@ public Scope PushOctetString(Asn1Tag? tag = null)
///
/// the writer is not currently positioned within an Octet String with the specified tag.
///
+ ///
+ /// In and modes,
+ /// the encoded contents will remain in a single primitive Octet String.
+ /// In mode, the contents will be broken up into
+ /// multiple segments, when required.
+ ///
public void PopOctetString(Asn1Tag? tag = default)
{
CheckUniversalTag(tag, UniversalTagNumber.OctetString);
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.SetOf.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.SetOf.cs
index 9cf4082c3aa7d..94baebad4d32f 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.SetOf.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.SetOf.cs
@@ -14,16 +14,16 @@ public sealed partial class AsnWriter
///
/// A disposable value which will automatically call .
///
- ///
- /// In and modes
- /// the writer will sort the Set-Of elements when the tag is closed.
- ///
///
/// . is
/// , but
/// . is not correct for
/// the method.
///
+ ///
+ /// In and modes,
+ /// the writer will sort the Set-Of elements when the tag is closed.
+ ///
///
public Scope PushSetOf(Asn1Tag? tag = null)
{
@@ -38,10 +38,6 @@ public Scope PushSetOf(Asn1Tag? tag = null)
/// returning the writer to the parent context.
///
/// The tag to write, or for the default tag (Universal 17).
- ///
- /// In and modes
- /// the writer will sort the Set-Of elements when the tag is closed.
- ///
///
/// . is
/// , but
@@ -51,6 +47,10 @@ public Scope PushSetOf(Asn1Tag? tag = null)
///
/// the writer is not currently positioned within a Set-Of with the specified tag.
///
+ ///
+ /// In and modes,
+ /// the writer will sort the Set-Of elements when the tag is closed.
+ ///
///
public void PopSetOf(Asn1Tag? tag = null)
{
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs
index 4a724870586d1..a9df78f247225 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs
@@ -49,7 +49,7 @@ public AsnWriter(AsnEncodingRules ruleSet)
}
///
- /// Create a new with a given set of encoding rules and an initial capacity.
+ /// Initializes a new instance of with a given set of encoding rules and an initial capacity.
///
/// The encoding constraints for the writer.
/// The minimum capacity with which to initialize the underlying buffer.
@@ -730,6 +730,14 @@ public override int GetHashCode()
public static bool operator !=(StackFrame left, StackFrame right) => !left.Equals(right);
}
+ ///
+ /// Represents a pushed ASN.1 scope.
+ ///
+ ///
+ /// Instances of this type are expected to be created from a Push member on ,
+ /// not instantiated directly.
+ /// Calling will call the corresponding Pop associated with the Push.
+ ///
public readonly struct Scope : IDisposable
{
private readonly AsnWriter _writer;
@@ -745,6 +753,12 @@ internal Scope(AsnWriter writer)
_depth = _writer._nestingStack.Count;
}
+ ///
+ /// Pops the ASN.1 scope.
+ ///
+ ///
+ /// A scope was pushed within this scope, but has yet to be popped.
+ ///
public void Dispose()
{
Debug.Assert(_writer == null || _writer._nestingStack != null);
diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/TagClass.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/TagClass.cs
index acf37815c3144..254ceb13b26c0 100644
--- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/TagClass.cs
+++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/TagClass.cs
@@ -11,22 +11,22 @@ namespace System.Formats.Asn1
public enum TagClass
{
///
- /// The Universal tag class
+ /// The Universal tag class.
///
Universal = 0,
///
- /// The Application tag class
+ /// The Application tag class.
///
Application = 0b0100_0000,
///
- /// The Context-Specific tag class
+ /// The Context-Specific tag class.
///
ContextSpecific = 0b1000_0000,
///
- /// The Private tag class
+ /// The Private tag class.
///
Private = 0b1100_0000,
}