System.Formats.Asn1
Represents an ASN.1 tag, as described in ITU-T Recommendation X.680.
Gets the tag class to which this tag belongs.
Gets a value that indicates whether the tag represents a constructed encoding (), or
a primitive encoding ().
Gets the numeric value for this tag.
If is , this value can
be interpreted as a .
Creates an for a tag from the UNIVERSAL class.
One of the enumeration values that specifies the semantic type for this tag.
for a constructed tag, for a primitive tag.
is not a known value.
Creates an for a specified value within a specified tag class.
The tag class for this tag.
The numeric value for this tag.
for a constructed tag, for a primitive tag.
is not a known value.
-or-
is negative.
This constructor allows for the creation of undefined UNIVERSAL class tags.
Produces a tag with the same and
values, but whose is .
A tag with the same and
values, but whose is .
Produces a tag with the same and
values, but whose is .
A tag with the same and
values, but whose is .
Attempts to read a BER-encoded tag that starts at .
The read-only byte sequence whose beginning is a BER-encoded tag.
The decoded tag.
When this method returns, contains the number of bytes that contributed
to the encoded tag, 0 on failure. This parameter is treated as uninitialized.
if a tag was correctly decoded; otherwise, .
Reads a BER-encoded tag that starts at .
The read-only byte sequence whose beginning is a BER-encoded tag.
When this method returns, contains the number of bytes that contributed
to the encoded tag. This parameter is treated as uninitialized.
The decoded tag.
The provided data does not decode to a tag.
Reports the number of bytes required for the BER-encoding of this tag.
The number of bytes required for the BER-encoding of this tag.
Attempts to write the BER-encoded form of this tag to .
The start of where the encoded tag should be written.
Receives the value from on success, 0 on failure.
if . <
(), otherwise.
Writes the BER-encoded form of this tag to .
The start of where the encoded tag should be written.
The number of bytes written to .
. < .
Tests if has the same encoding as this tag.
The tag to test for equality.
if has the same values for
, , and ;
otherwise.
Tests if is an with the same
encoding as this tag.
The object to test for value equality.
if is not an ,
otherwise.
Returns the hash code for this instance.
A 32-bit signed integer hash code.
Tests if two values have the same BER encoding.
The first value to compare.
The second value to compare.
if and have the same
BER encoding, otherwise.
Tests if two values have a different BER encoding.
The first value to compare.
The second value to compare.
if and have a different
BER encoding, otherwise.
Tests if has the same and
values as this tag, and does not compare .
Tag to test for concept equality.
if has the same and
as this tag, otherwise.
Provides a text representation of this tag suitable for debugging.
A text representation of this tag suitable for debugging.
Represents the End-of-Contents meta-tag.
Represents the universal class tag for a Boolean value.
Represents the universal class tag for an Integer value.
Represents the universal class tag for a Bit String value under a primitive encoding.
Represents the universal class tag for a Bit String value under a constructed encoding.
Represents the universal class tag for an Octet String value under a primitive encoding.
Represents the universal class tag for a Octet String value under a constructed encoding.
Represents the universal class tag for a Null value.
Represents the universal class tag for an Object Identifier value.
Represents the universal class tag for an Enumerated value.
Represents the universal class tag for a Sequence value (always a constructed encoding).
Represents the universal class tag for a SetOf value (always a constructed encoding).
Represents the universal class tag for a UtcTime value.
Represents the universal class tag for a GeneralizedTime value.
Big-Endian UCS-2 encoding (the same as UTF-16BE, but disallowing surrogate pairs to leave plane 0)
Compatibility encoding for T61Strings. Interprets the characters as UTF-8 or
ISO-8859-1 as a fallback.
The exception that is thrown when an encoded ASN.1 value cannot be successfully decoded.
Initializes a new instance of the class, using the default message.
Initializes a new instance of the class, using the provided message.
The error message that explains the reason for the exception.
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.
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.
Specifies the encoding ruleset for an or .
ITU-T X.690 Basic Encoding Rules.
ITU-T X.690 Canonical Encoding Rules.
ITU-T X.690 Distinguished Encoding Rules.
Provides stateless methods for decoding BER-encoded, CER-encoded, and DER-encoded ASN.1 data.
Attempts to locate the contents range for the encoded value at the beginning of the
buffer using the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, contains the tag identifying the content.
This parameter is treated as uninitialized.
When this method returns, contains the offset of the content payload relative to the start of
.
This parameter is treated as uninitialized.
When this method returns, contains the number of bytes in the content payload (which may be 0).
This parameter is treated as uninitialized.
When this method returns, contains the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
if represents a valid structural
encoding for the specified encoding rules; otherwise, .
This method performs very little validation on the contents.
If the encoded value uses a definite length, the contents are not inspected at all.
If the encoded value uses an indefinite length, the contents are only inspected
as necessary to determine the location of the relevant end-of-contents marker.
When the encoded value uses an indefinite length, the
value will be larger than the sum of and
to account for the end-of-contents marker.
is not defined.
Locates the contents range for the encoded value at the beginning of the
buffer using the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, contains the offset of the content payload relative to the start of
.
This parameter is treated as uninitialized.
When this method returns, contains the number of bytes in the content payload (which may be 0).
This parameter is treated as uninitialized.
When this method returns, contains the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag identifying the content.
This method performs very little validation on the contents.
If the encoded value uses a definite length, the contents are not inspected at all.
If the encoded value uses an indefinite length, the contents are only inspected
as necessary to determine the location of the relevant end-of-contents marker.
When the encoded value uses an indefinite length, the
value will be larger than the sum of and
to account for the end-of-contents marker.
is not defined.
does not represent a value encoded under the specified
encoding rules.
Decodes the data in as a length value under the specified
encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, contains the number of bytes from the beginning of
that contributed to the length.
This parameter is treated as uninitialized.
The decoded value of the length, or if the
encoded length represents the indefinite length.
is not a known value.
does not decode as a length under the specified encoding rules.
This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet,
so needs to have already sliced off the encoded tag.
Attempts to decode the data in as a length value under the specified
encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
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, contains the number of bytes from the beginning of
that contributed to the length.
This parameter is treated as uninitialized.
if the buffer represents a valid length under the specified encoding rules;
otherwise,
is not a known value.
This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet,
so needs to have already sliced off the encoded tag.
Get the number of bytes between the start of and
the End-of-Contents marker.
Attempts to get a Bit String value from with a specified tag under
the specified encoding rules, if the value is contained in a single (primitive) encoding.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
This parameter is treated as uninitialized.
On success, receives a slice of the input buffer that corresponds to
the value of the Bit String.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
if the Bit String value has a primitive encoding and all of the bits
reported as unused are set to 0;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to copy a Bit String value from with a specified tag under
the specified encoding rules into .
The buffer containing encoded data.
The buffer in which to write.
The encoding constraints to use when interpreting the data.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes written to .
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
if is large enough to receive the
value of the Bit String;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
-or-
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.
Reads a Bit String value from with a specified tag under
the specified encoding rules, returning the contents in a new array.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
An array containing the contents of the Bit String value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Reads a Boolean value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 1).
The decoded value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads an Enumerated value from with a specified tag under
the specified encoding rules, returning the contents as a slice of the buffer.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 10).
The slice of the buffer containing the bytes of the Enumerated value,
in signed big-endian form.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads an Enumerated from with a specified tag under
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.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 10).
The Enumerated value converted to a .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was declared with .
-or-
. is
, but
. is not correct for
the method.
This method does not validate that the return value is defined within
.
Reads an Enumerated from with a specified tag under
the specified encoding rules, converting it to the
non-[] enum specified by .
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
Type object representing the destination type.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 10).
The Enumerated value converted to a .
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was declared with .
-or-
. is
, but
. is not correct for
the method.
is .
This method does not validate that the return value is defined within
.
Reads a GeneralizedTime value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 24).
The decoded value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads an Integer value from with a specified tag under
the specified encoding rules, returning the contents as a slice of the buffer.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
The slice of the buffer containing the bytes of the Integer value, in signed big-endian form.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads an Integer value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
The decoded numeric value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read an Integer value from with a specified tag under
the specified encoding rules as a signed 32-bit value.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the interpreted numeric value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
if the Integer represents value is between
Int32.MinValue and Int32.MaxValue, inclusive; otherwise,
.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read an Integer value from with a specified tag under
the specified encoding rules as an unsigned 32-bit value.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the interpreted numeric value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
if the Integer represents value is between
UInt32.MinValue and UInt32.MaxValue, inclusive; otherwise,
.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read an Integer value from with a specified tag under
the specified encoding rules as a signed 64-bit value.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the interpreted numeric value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
if the Integer represents value is between
Int64.MinValue and Int64.MaxValue, inclusive; otherwise,
.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read an Integer value from with a specified tag under
the specified encoding rules as an unsigned 64-bit value.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives the interpreted numeric value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 2).
if the Integer represents value is between
UInt64.MinValue and UInt64.MaxValue, inclusive; otherwise,
.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads a NamedBitList from with a specified tag under
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.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
The NamedBitList value converted to a .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was not declared with
-or-
. is
, but
. is not correct for
the method.
The bit alignment performed by this method is to interpret the most significant bit
in the first byte of the value as the least significant bit in ,
with bits increasing in value until the least significant bit of the first byte, proceeding
with the most significant bit of the second byte, and so on. Under this scheme, the following
ASN.1 type declaration and C# enumeration can be used together:
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1),
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
[Flags]
enum KeyUsage
{
None = 0,
DigitalSignature = 1 << (0),
NonRepudiation = 1 << (1),
KeyEncipherment = 1 << (2),
DataEncipherment = 1 << (3),
KeyAgreement = 1 << (4),
KeyCertSign = 1 << (5),
CrlSign = 1 << (6),
EncipherOnly = 1 << (7),
DecipherOnly = 1 << (8),
}
While the example here uses the KeyUsage NamedBitList from
RFC 3280 (4.2.1.3),
the example enum uses values that are different from
System.Security.Cryptography.X509Certificates.X509KeyUsageFlags.
Reads a NamedBitList from with a specified tag under
the specified encoding rules, converting it to the
[] enum specified by .
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
Type object representing the destination type.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
The NamedBitList value converted to a .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was not declared with
-or-
. is
, but
. is not correct for
the method.
is
Reads a NamedBitList from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 3).
The bits from the encoded value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
The bit alignment performed by this method is to interpret the most significant bit
in the first byte of the value as bit 0,
with bits increasing in value until the least significant bit of the first byte, proceeding
with the most significant bit of the second byte, and so on.
This means that the number used in an ASN.1 NamedBitList construction is the index in the
return value.
Reads a Null value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 5).
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to get an Octet String value from with a specified tag under
the specified encoding rules, copying the value into the provided destination buffer.
The buffer containing encoded data.
The buffer in which to write.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes written to .
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 4).
if is large enough to receive the
value of the Octet String;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
-or-
overlaps .
Reads an Octet String value from with a specified tag under
the specified encoding rules, returning the contents in a new array.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 4).
An array containing the contents of the Octet String value.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to get an Octet String value from with a specified tag under
the specified encoding rules, if the value is contained in a single (primitive) encoding.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
On success, receives a slice of the input buffer that corresponds to
the value of the Octet String.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 4).
if the Octet String value has a primitive encoding;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads an Object Identifier value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 6).
The decoded object identifier in the dotted-decimal notation.
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads a Sequence or Sequence-Of value from with a specified tag
under the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the offset of the content payload relative to the start of
.
This parameter is treated as uninitialized.
When this method returns, the number of bytes in the content payload (which may be 0).
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the default tag (Universal 16).
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Reads a Set-Of value from with a specified tag
under the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the offset of the content payload relative to the start of
.
This parameter is treated as uninitialized.
When this method returns, the number of bytes in the content payload (which may be 0).
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
to always accept the data in the order it is presented,
to verify that the data is sorted correctly when the
encoding rules say sorting was required (CER and DER).
The tag to check for before reading, or for the default tag (Universal 17).
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Attempts to get an unprocessed character string value from with a
specified tag under the specified encoding rules, if the value is contained in a single
(primitive) encoding.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
The tag to check for before reading.
On success, receives a slice of the input buffer that corresponds to
the value of the Bit String.
This parameter is treated as uninitialized.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
if the character string value has a primitive encoding;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not a character
string tag type.
This method does not determine if the string used only characters defined by the encoding.
Attempts to read a character string value from with a
specified tag under the specified encoding rules,
copying the unprocessed bytes into the provided destination buffer.
The buffer containing encoded data.
The buffer in which to write.
The encoding constraints to use when interpreting the data.
The tag to check for before reading.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
On success, receives the number of bytes written to .
if is large enough to receive the
value of the unprocessed character string;
otherwise, .
is not defined.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not a character
string tag type.
-or-
overlaps .
This method does not determine if the string used only characters defined by the encoding.
Reads a character string value from with a specified tag under
the specified encoding rules, copying the decoded string into a provided destination buffer.
The buffer containing encoded data.
The buffer in which to write.
The encoding constraints to use when interpreting the data.
One of the enumeration values which represents the value type to process.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
When this method returns, the number of chars written to .
This parameter is treated as uninitialized.
The tag to check for before reading, or for the universal tag that is
appropriate to the requested encoding type.
and advances the reader if had sufficient
length to receive the value, otherwise
and the reader does not advance.
is not defined.
-or-
is not a known character string type.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The string did not successfully decode.
. is
, but
. is not the same as
.
Reads the next value as character string with the specified tag and
encoding type, returning the decoded string.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
One of the enumeration values which represents the value type to process.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The tag to check for before reading, or for the universal tag that is
appropriate to the requested encoding type.
The decoded value.
is not defined.
-or-
is not a known character string type.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The string did not successfully decode.
. is
, but
. is not the same as
.
Reads a UtcTime value from with a specified tag under
the specified encoding rules.
The buffer containing encoded data.
The encoding constraints to use when interpreting the data.
When this method returns, the total number of bytes for the encoded value.
This parameter is treated as uninitialized.
The largest year to represent with this value.
The default value, 2049, represents the 1950-2049 range for X.509 certificates.
The tag to check for before reading, or for the default tag (Universal 24).
The decoded value.
is not defined.
-or-
is not in the range [99, 9999].
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Represents a stateful, forward-only reader for BER-encoded, CER-encoded, or DER-encoded ASN.1 data.
Gets the encoding rules in use by this reader.
The encoding rules in use by this reader.
Gets a value that indicates whether the reader has remaining data available to process.
if there is more data available for the reader to process;
otherwise, .
Construct an over with a given ruleset.
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 copy . The caller is responsible for
ensuring that the values do not change until the reader is finished.
Throws a standardized if the reader has remaining
data, or performs no function if returns .
This method provides a standardized target and standardized exception for reading a
"closed" structure, such as the nested content for an explicitly tagged value.
Reads the encoded tag at the next data position, without advancing the reader.
The decoded tag value.
A tag could not be decoded at the reader's current position.
Gets a view of the next encoded value without
advancing the reader. For indefinite length encodings, this includes the
End of Contents marker.
The bytes of the next encoded value.
The reader is positioned at a point where the tag or length is invalid
under the current encoding rules.
Gets a view of the content octets (bytes) of the
next encoded value without advancing the reader.
The bytes of the contents octets of the next encoded value.
The reader is positioned at a point where the tag or length is invalid
under the current encoding rules.
Get a view of the next encoded value,
and advance the reader past it. For an indefinite length encoding, this includes
the End of Contents marker.
A view of the next encoded value.
Clones the current reader.
A clone of the current reader.
This does not create a clone of the ASN.1 data, only the reader's state is cloned.
Reads the next value as a BIT STRING with a specified tag, returning the contents
as a over the original data.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
On success, receives a over the original data
corresponding to the value of the BIT STRING.
The tag to check for before reading, or for the default tag (Universal 1).
and advances the reader if the BIT 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.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a BIT STRING with a specified tag, copying the value
into a provided destination buffer.
The buffer in which to write.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
On success, receives the number of bytes written to .
The tag to check for before reading, or for the default tag (Universal 1).
and advances the reader if had sufficient
length to receive the value, otherwise
and the reader does not advance.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a BIT STRING with a specified tag, returning the value
in a byte array.
On success, receives the number of bits in the last byte which were reported as
"unused" by the writer.
The tag to check for before reading, or for the default tag (Universal 1).
A copy of the value in a newly allocated, precisely sized, array.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a Boolean with a specified tag.
The tag to check for before reading, or for the default tag (Universal 1).
The decoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a Enumerated with a specified tag, returning the contents
as a over the original data.
The tag to check for before reading, or for the default tag (Universal 10).
The bytes of the Enumerated value, in signed big-endian form.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
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).
The Enumerated value converted to a .
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was declared with .
-or-
. is
, but
. is not correct for
the method.
This method does not validate that the return value is defined within
.
Reads the next value as an Enumerated with a specified tag, converting it to the
non-[] enum specified by .
Type object representing the destination type.
The tag to check for before reading, or for the default tag (Universal 10).
The Enumerated value converted to a .
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was declared with .
-or-
. is
, but
. is not correct for
the method.
is .
This method does not validate that the return value is defined within
.
Reads the next value as a GeneralizedTime with a specified tag.
The tag to check for before reading, or for the default tag (Universal 24).
The decoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a Integer with a specified tag, returning the contents
as a over the original data.
The tag to check for before reading, or for the default tag (Universal 2).
The bytes of the Integer value, in signed big-endian form.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as an Integer with a specified tag.
The tag to check for before reading, or for the default tag (Universal 2).
The decoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read the next value as an Integer with a specified tag,
as a signed 32-bit value.
On success, receives the decoded value.
The tag to check for before reading, or for the default tag (Universal 2).
and does not advance the reader if the value is not between
Int32.MinValue and Int32.MaxValue, inclusive; otherwise
is returned and the reader advances.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read the next value as an Integer with a specified tag,
as an unsigned 32-bit value.
On success, receives the decoded value.
The tag to check for before reading, or for the default tag (Universal 2).
and does not advance the reader if the value is not between
UInt32.MinValue and UInt32.MaxValue, inclusive; otherwise
is returned and the reader advances.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read the next value as an Integer with a specified tag,
as a signed 64-bit value.
On success, receives the decoded value.
The tag to check for before reading, or for the default tag (Universal 2).
and does not advance the reader if the value is not between
Int64.MinValue and Int64.MaxValue, inclusive; otherwise
is returned and the reader advances.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read the next value as an Integer with a specified tag,
as an unsigned 64-bit value.
On success, receives the decoded value.
The tag to check for before reading, or for the default tag (Universal 2).
and does not advance the reader if the value is not between
Int64.MinValue and Int64.MaxValue, inclusive; otherwise
is returned and the reader advances.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
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.
The NamedBitList value converted to a .
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was not declared with
-or-
. is
, but
. is not correct for
the method.
The bit alignment performed by this method is to interpret the most significant bit
in the first byte of the value as the least significant bit in ,
with bits increasing in value until the least significant bit of the first byte, proceeding
with the most significant bit of the second byte, and so on. Under this scheme, the following
ASN.1 type declaration and C# enumeration can be used together:
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1),
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
[Flags]
enum KeyUsage
{
None = 0,
DigitalSignature = 1 << (0),
NonRepudiation = 1 << (1),
KeyEncipherment = 1 << (2),
DataEncipherment = 1 << (3),
KeyAgreement = 1 << (4),
KeyCertSign = 1 << (5),
CrlSign = 1 << (6),
EncipherOnly = 1 << (7),
DecipherOnly = 1 << (8),
}
While the example here uses the KeyUsage NamedBitList from
RFC 3280 (4.2.1.3),
the example enum uses values that are different from
System.Security.Cryptography.X509Certificates.X509KeyUsageFlags.
Reads the next value as a NamedBitList with a specified tag, converting it to the
[] enum specified by .
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.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The encoded value is too big to fit in a value.
is not an enum type.
-or-
was not declared with
-or-
. is
, but
. is not correct for
the method.
is
Reads the next value as a NamedBitList with a specified tag.
The tag to check for before reading.
The bits from the encoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a NULL with a specified tag.
The tag to check for before reading, or for the default tag (Universal 5).
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as an OCTET STRING with a specified tag, copying the value
into a provided destination buffer.
The buffer in which to write.
On success, receives the number of bytes written to .
The tag to check for before reading, or for the default tag (Universal 4).
and advances the reader if had sufficient
length to receive the value, otherwise
and the reader does not advance.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as an OCTET STRING with tag UNIVERSAL 4, returning the value
in a byte array.
The tag to check for before reading, or for the default tag (Universal 4).
A copy of the value in a newly allocated, precisely sized, array.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Attempts to read the next value as an OCTET STRING with a specified tag, returning the contents
as a over the original data.
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.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as an OBJECT IDENTIFIER with a specified tag, returning
the value in a dotted decimal format string.
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.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a SEQUENCE or SEQUENCE-OF with the specified tag
and returns the result as a new reader positioned at the first
value in the sequence (or with == ).
The tag to check for before reading, or for the default tag (Universal 16).
A new reader positioned at the first
value in the sequence (or with == ).
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Reads the next value as a SET-OF with the specified tag
and returns the result as a new reader positioned at the first
value in the set-of (or with == ),
using the value
from the constructor (default ).
The tag to check for before reading, or for the default tag (Universal 17).
A new reader positioned at the first
value in the set-of (or with == ).
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Reads the next value as a SET-OF with the specified tag
and returns the result as a new reader positioned at the first
value in the set-of (or with == ).
to always accept the data in the order it is presented,
to verify that the data is sorted correctly when the
encoding rules say sorting was required (CER and DER).
The tag to check for before reading, or for the default tag (Universal 17).
A new reader positioned at the first
value in the set-of (or with == ).
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. 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.
Reads the next value as a character with a specified tag, returning the contents
as an unprocessed 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 character string.
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.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not a character
string tag type.
This method does not determine if the string used only characters defined by the encoding.
Reads the next value as character string with the specified tag,
copying the unprocessed bytes into a provided destination buffer.
The buffer in which to write.
The tag to check for before reading.
On success, receives the number of bytes written to .
and advances the reader if had sufficient
length to receive the value, otherwise
and the reader does not advance.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not a character
string tag type.
This method does not determine if the string used only characters defined by the encoding.
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.
On success, receives the number of chars written to .
The tag to check for before reading, or for the universal tag that is
appropriate to the requested encoding type.
and advances the reader if had sufficient
length to receive the value, otherwise
and the reader does not advance.
is not a known character string type.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The string did not successfully decode.
. is
, but
. is not the same as
.
Reads the next value as character string with the specified tag and
encoding type, returning the decoded value as a string.
One of the enumeration values representing the value type to process.
The tag to check for before reading, or for the universal tag that is
appropriate to the requested encoding type.
The decoded value.
is not a known character string type.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
-or-
The string did not successfully decode.
. is
, but
. is not the same as
.
Reads the next value as a UTCTime with a specified tag using the
value from options passed to
the constructor (with a default of 2049).
The tag to check for before reading, or for the default tag (Universal 23).
The decoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Reads the next value as a UTCTime with a specified tag.
The largest year to represent with this value.
The tag to check for before reading, or for the default tag (Universal 23).
The decoded value.
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
. is
, but
. is not correct for
the method.
Specifies options that modify the behavior of an .
Gets or sets the largest year to represent with a UtcTime value.
The largest year to represent with a UtcTime value. The default is 2049.
Gets or sets a value that indicates whether the reader should bypass sort ordering
on a Set or Set-Of value.
if the reader should not validate that a Set or Set-Of value
is sorted correctly for the current encoding rules; otherwise .
The default is .
A writer for BER-encoded, CER-encoded, and DER-encoded ASN.1 data.
Gets the encoding rules in use by this writer.
The encoding rules in use by this writer.
Creates a new with a given set of encoding rules.
The encoding constraints for the writer.
is not defined.
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.
is not defined.
-or-
is a negative number.
Specifying with a value of zero behaves as if no initial capacity were
specified.
Resets the writer to have no data, without releasing resources.
Gets the number of bytes that would be written by .
The number of bytes that would be written by .
, , or
was called without the corresponding
Pop method.
Attempts to write the encoded representation of the data to .
The buffer in which to write.
When this method returns, contains the number of bytes written to .
if the encode succeeded,
if is too small.
A or has not been closed via
or .
Writes the encoded representation of the data to .
The buffer in which to write.
The number of bytes written to .
A or has not been closed via
or .
Returns a new array containing the encoded value.
A precisely-sized array containing the encoded value.
A or has not been closed via
or .
Determines if would produce an output identical to
.
if the pending encoded data is identical to ,
otherwise.
A or has not been closed via
or .
Determines if would produce an output identical to
.
if the pending encoded data is identical to ,
otherwise.
is .
A or has not been closed via
or .
Copies the value of this writer into another.
The writer to receive the value.
is .
A or has not been closed via
or .
-or-
This writer is empty.
-or-
This writer represents more than one top-level value.
-or-
This writer's value is encoded in a manner that is not compatible with the
ruleset for the destination writer.
Writes a single value that has already been encoded.
The value to write.
This method only checks that the tag and length are encoded according to the current ruleset,
and that the end of the value is the end of the input. The contents are not evaluated for
semantic meaning.
could not be read under the current encoding rules.
-or-
has data beyond the end of the first value.
Represents a pushed ASN.1 scope.
Instances of this type are expected to be created from a Push member on ,
not instantiated directly.
Calling calls the corresponding Pop associated with the Push.
Pops the ASN.1 scope.
A scope was pushed within this scope, but has yet to be popped.
Write a Bit String value with a specified tag.
The value to write.
The number of trailing bits which are not semantic.
The tag to write, or for the default tag (Universal 3).
. is
, but
. is not correct for
the method.
-or-
has length 0 and is not 0
-or-
is not empty and any of the bits identified by
is set.
is not in the range [0,7].
Write a Boolean value with a specified tag.
The value to write.
The tag to write, or for the default tag (Universal 1).
. is
, but
. is not correct for
the method.
Write a non-[] enum value as an Enumerated with
tag UNIVERSAL 10.
The boxed enumeration value to write.
The tag to write, or for the default tag (Universal 10).
is .
. is
, but
. is not correct for
the method.
-or-
is not a boxed enum value.
-or-
the unboxed type of is declared [].
Write a non-[] enum value as an Enumerated with
tag UNIVERSAL 10.
The boxed enumeration value to write.
The tag to write.
is .
. is
, but
. is not correct for
the method.
-or-
is not an enum.
-or-
is declared [].
Write the provided as a GeneralizedTime with a specified
UNIVERSAL 24, optionally excluding the fractional seconds.
The value to write.
to treat the fractional seconds in as 0 even if
a non-zero value is present.
The tag to write, or for the default tag (Universal 24).
. is
, but
. is not correct for
the method.
Write an Integer value with a specified tag.
The value to write.
The tag to write, or for the default tag (Universal 2).
. is
, but
. is not correct for
the method.
Write an Integer value with a specified tag.
The value to write.
The tag to write, or for the default tag (Universal 2).
. is
, but
. is not correct for
the method.
Write an Integer value with a specified tag.
The value to write.
The tag to write, or for the default tag (Universal 2).
. is
, but
. is not correct for
the method.
Write an Integer value with a specified tag.
The integer value to write, in signed big-endian byte order.
The tag to write, or for the default tag (Universal 2).
. is
, but
. is not correct for
the method.
The 9 most significant bits are all set.
-or-
The 9 most significant bits are all unset.
Write an Integer value with a specified tag.
The integer value to write, in unsigned big-endian byte order.
The tag to write, or for the default tag (Universal 2).
. is
, but
. is not correct for
the method.
The 9 most significant bits are all unset.
Write a [] enum value as a NamedBitList with
a specified tag.
The boxed enumeration value to write
The tag to write, or for the default tag (Universal 3).
. is
, but
. is not correct for
the method.
-or-
is not a boxed enum value.
-or-
the unboxed type of is not declared [].
is .
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).
. is
, but
. is not correct for
the method.
-or-
is not an enum value.
-or-
is not declared [].
Write a bit array value as a NamedBitList with a specified tag.
The bits to write
The tag to write, or for the default tag (Universal 3).
. is
, but
. is not correct for
the method.
is .
The index of the bit array corresponds to the bit number in the encoded format, which is
different than the value produced by with a byte array.
For example, the bit array { false, true, true } encodes as 0b0110_0000 with 5
unused bits.
Write NULL with a specified tag.
The tag to write, or for the default tag (Universal 5).
. is
, but
. is not correct for
the method.
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 .
This method is just an accelerator for writing an Octet String value where the
contents are also ASN.1 data encoded under the same encoding system.
When is called the entire nested contents are
normalized as a single Octet String value, encoded correctly for the current encoding
rules.
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.
Indicate that the open Octet String with the tag UNIVERSAL 4 is closed,
returning the writer to the parent context.
The tag to write, or for the default tag (Universal 4).
. is
, but
. is not correct for
the method.
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.
Write an Octet String value with a specified tag.
The value to write.
The tag to write, or for the default tag (Universal 4).
. is
, but
. is not correct for
the method.
Write an Object Identifier with a specified tag.
The object identifier to write.
The tag to write, or for the default tag (Universal 6).
. is
, but
. is not correct for
the method.
-or-
is not a valid dotted decimal
object identifier.
is .
Write an Object Identifier with a specified tag.
The object identifier to write.
The tag to write, or for the default tag (Universal 6).
. is
, but
. is not correct for
the method.
-or-
is not a valid dotted decimal
object identifier.
Begin writing a Sequence with a specified tag.
The tag to write, or for the default tag (Universal 16).
A disposable value which will automatically call .
. is
, but
. is not correct for
the method.
Indicate that the open Sequence with the specified tag is closed,
returning the writer to the parent context.
The tag to write, or for the default tag (Universal 16).
. is
, but
. is not correct for
the method.
the writer is not currently positioned within a Sequence with the specified tag.
Begin writing a Set-Of with a specified tag.
The tag to write, or for the default tag (Universal 17).
A disposable value which will automatically call .
. is
, but
. is not correct for
the method.
In and modes,
the writer will sort the Set-Of elements when the tag is closed.
Indicate that the open Set-Of with the specified tag is closed,
returning the writer to the parent context.
The tag to write, or for the default tag (Universal 17).
. is
, but
. is not correct for
the method.
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.
Write the provided string using the specified encoding type using the specified
tag corresponding to the encoding type.
One of the enumeration values representing the encoding to use.
The string to write.
The tag to write, or for the universal tag that is appropriate to
the requested encoding type.
is
is not a restricted character string encoding type.
-or-
is a restricted character string encoding type that is not
currently supported by this method.
. is
, but
. is not correct for
the method.
Write the provided string using the specified encoding type using the specified
tag corresponding to the encoding type.
One of the enumeration values representing the encoding to use.
The string to write.
The tag to write, or for the universal tag that is appropriate to
the requested encoding type.
is not a restricted character string encoding type.
-or-
is a restricted character string encoding type that is not
currently supported by this method.
. is
, but
. is not correct for
the method.
Write the provided value as a UTCTime with a specified tag,
accepting the two-digit year as valid in context.
The value to write.
The tag to write, or for the default tag (Universal 23).
. is
, but
. is not correct for
the method.
Write the provided value as a UTCTime with a specified tag,
provided the year is in the allowed range.
The value to write.
The maximum valid year for , after conversion to UTC.
For the X.509 Time.utcTime range of 1950-2049, pass 2049.
The tag to write, or for the default tag (Universal 23).
. is
, but
. is not correct for
the method.
. (after conversion to UTC)
is not in the range
( - 100, ].
Specifies the tag class for a particular ASN.1 tag.
The Universal tag class.
The Application tag class.
The Context-Specific tag class.
The Private tag class.
Specifies tag assignments for the UNIVERSAL class in ITU-T X.680.
The reserved identifier for the End-of-Contents marker in an indefinite
length encoding.
The universal class tag value for Boolean.
The universal class tag value for Integer.
The universal class tag value for Bit String.
The universal class tag value for Octet String.
The universal class tag value for Null.
The universal class tag value for Object Identifier.
The universal class tag value for Object Descriptor.
The universal class tag value for External.
The universal class tag value for Instance-Of.
The universal class tag value for Real.
The universal class tag value for Enumerated.
The universal class tag value for Embedded-PDV.
The universal class tag value for UTF8String.
The universal class tag value for Relative Object Identifier.
The universal class tag value for Time.
The universal class tag value for Sequence.
The universal class tag value for Sequence-Of.
The universal class tag value for Set.
The universal class tag value for Set-Of.
The universal class tag value for NumericString.
The universal class tag value for PrintableString.
The universal class tag value for TeletexString (T61String).
The universal class tag value for T61String (TeletexString).
The universal class tag value for VideotexString.
The universal class tag value for IA5String.
The universal class tag value for UTCTime.
The universal class tag value for GeneralizedTime.
The universal class tag value for GraphicString.
The universal class tag value for VisibleString (ISO646String).
The universal class tag value for ISO646String (VisibleString).
The universal class tag value for GeneralString.
The universal class tag value for UniversalString.
The universal class tag value for an unrestricted character string.
The universal class tag value for BMPString.
The universal class tag value for Date.
The universal class tag value for Time-Of-Day.
The universal class tag value for Date-Time.
The universal class tag value for Duration.
The universal class tag value for Object Identifier
Internationalized Resource Identifier (IRI).
The universal class tag value for Relative Object Identifier
Internationalized Resource Identifier (IRI).
Destination is too short.
ASN.1 Enumerated values only apply to enum types without the [Flags] attribute.
Enumerations with a backing type of '{0}' are not supported for ReadEnumeratedValue.
The OID value is invalid.
Named bit list operations require an enum with the [Flags] attribute.
The destination buffer overlaps the source buffer.
The specified tag has the Universal TagClass, but the TagValue does not correspond with a known character string type.
An integer value cannot be empty.
The first 9 bits of the integer value all have the same value. Ensure the input is in big-endian byte order and that all redundant leading bytes have been removed.
Tags with TagClass Universal must have the appropriate TagValue value for the data type being read or written.
Unused bit count must be 0 when the bit string is empty.
Unused bit count must be between 0 and 7, inclusive.
One or more of the bits covered by the provided unusedBitCount value is set. All unused bits must be cleared.
The input to WriteEncodedValue must represent a single encoded value with no trailing data.
Non-negative number required.
Encode cannot be called while a Sequence, Set-Of, or Octet String is still open.
The AsnWriter cannot be written to while performing the Encode callback.
Cannot pop the requested tag as it is not currently in progress.
A constructed tag used a definite length encoding, which is invalid for CER data. The input may be encoded with BER or DER.
The encoded value uses a primitive encoding, which is invalid for '{0}' values.
The ASN.1 value is invalid.
The encoded enumerated value is larger than the value size of the '{0}' enum.
The encoded value is not valid under the selected encoding, but it may be valid under the BER or DER encoding.
The encoded value is not valid under the selected encoding, but it may be valid under the BER encoding.
The encoded value is not valid under the selected encoding, but it may be valid under the BER or CER encoding.
The provided data does not represent a valid tag.
The encoded length exceeds the number of bytes remaining in the input buffer.
The encoded length is not valid under the requested encoding rules, the value may be valid under the BER encoding.
The encoded length exceeds the maximum supported by this library (Int32.MaxValue).
The encoded named bit list value is larger than the value size of the '{0}' enum.
The encoded object identifier (OID) exceeds the limits supported by this library. Supported OIDs are limited to 64 arcs and each subidentifier is limited to a 128-bit value.
The encoded value uses a constructed encoding, which is invalid for '{0}' values.
The encoded set is not sorted as required by the current encoding rules. The value may be valid under the BER encoding, or you can ignore the sort validation by specifying skipSortValidation=true.
The last expected value has been read, but the reader still has pending data. This value may be from a newer schema, or is corrupt.
The provided data is tagged with '{0}' class value '{1}', but it should have been '{2}' class value '{3}'.
Attribute used to indicate a source generator should create a function for marshalling
arguments instead of relying on the runtime to generate an equivalent marshalling function at run-time.
This attribute is meaningless if the source generator associated with it is not enabled.
The current built-in source generator only supports C# and only supplies an implementation when
applied to static, partial, non-generic methods.
Initializes a new instance of the .
Name of the library containing the import.
Gets the name of the library containing the import.
Gets or sets the name of the entry point to be called.
Gets or sets how to marshal string arguments to the method.
If this field is set to a value other than ,
must not be specified.
Gets or sets the used to control how string arguments to the method are marshalled.
If this field is specified, must not be specified
or must be set to .
Gets or sets whether the callee sets an error (SetLastError on Windows or errno
on other platforms) before returning from the attributed method.
Specifies how strings should be marshalled for generated p/invokes
Indicates the user is supplying a specific marshaller in .
Use the platform-provided UTF-8 marshaller.
Use the platform-provided UTF-16 marshaller.
Specifies that null is allowed as an input even if the corresponding type disallows it.
Specifies that null is disallowed as an input even if the corresponding type allows it.
Specifies that an output may be null even if the corresponding type disallows it.
Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.
Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter may be null.
Gets the return value condition.
Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter will not be null.
Gets the return value condition.
Specifies that the output will be non-null if the named parameter is non-null.
Initializes the attribute with the associated parameter name.
The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
Gets the associated parameter name.
Applied to a method that will never return under any circumstance.
Specifies that the method will not return if the associated Boolean parameter is passed the specified value.
Initializes the attribute with the specified parameter value.
The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
the associated parameter matches this value.
Gets the condition parameter value.
Specifies that the method or property will ensure that the listed field and property members have not-null values.
Initializes the attribute with a field or property member.
The field or property member that is promised to be not-null.
Initializes the attribute with the list of field and property members.
The list of field and property members that are promised to be not-null.
Gets field or property member names.
Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.
Initializes the attribute with the specified return value condition and a field or property member.
The return value condition. If the method returns this value, the associated field or property member will not be null.
The field or property member that is promised to be not-null.
Initializes the attribute with the specified return value condition and list of field and property members.
The return value condition. If the method returns this value, the associated field and property members will not be null.
The list of field and property members that are promised to be not-null.
Gets the return value condition.
Gets field or property member names.
Provides downlevel polyfills for static methods on Exception-derived types.