AsnReader.TryReadPrimitiveOctetString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to read the next value as an OCTET STRING with a specified tag, returning the contents as a ReadOnlyMemory<T> over the original data.
public bool TryReadPrimitiveOctetString (out ReadOnlyMemory<byte> contents, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.TryReadPrimitiveOctetString : ReadOnlyMemory * Nullable<System.Formats.Asn1.Asn1Tag> -> bool
Public Function TryReadPrimitiveOctetString (ByRef contents As ReadOnlyMemory(Of Byte), Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Boolean
Parameters
- contents
- ReadOnlyMemory<Byte>
On success, receives a ReadOnlyMemory<T> over the original data corresponding to the value of the OCTET STRING.
Returns
true
and advances the reader if the OCTET STRING value had a primitive encoding,
false
and does not advance the reader if it had a constructed encoding.
Exceptions
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.