Show / Hide Table of Contents

TlvWriter Class

Namespace: Yubico.Core.Tlv Assembly: Yubico.Core.dll

Use this class to build TLV (tag-length-value) constructions.

C#
public sealed class TlvWriter
Inheritance object TlvWriter

Remarks

See the User's Manual entry on TLV for an in-depth discussion of what TLV is and a general description of how to use this class.

Constructors

Name Description
TlvWriter()

Create a new TlvWriter object.

Methods

Name Description
Clear()

Clear any data that had been copied from input.

Encode()

Write out the encoding of the structure defined, returning a new byte array containing the result.

GetEncodedLength()

Get the length the encoding will be.

TryEncode(Span<byte>, out int)

Write out the encoding of the structure defined, placing the result into the destination.

WriteByte(int, byte)

Add a byte as the value to be written out.

WriteEncoded(ReadOnlySpan<byte>)

Add an encoded byte array to be written out.

WriteInt16(int, short, bool)

Add a 16-bit integer as the value to be written out.

WriteInt32(int, int, bool)

Add a 32-bit integer as the value to be written out.

WriteNestedTlv(int)

Start a new Nested TLV.

WriteString(int, string, Encoding)

Add a string as the value to be written out.

WriteUInt16(int, ushort, bool)

Add an unsigned 16-bit integer as the value to be written out.

WriteValue(int, ReadOnlySpan<byte>)

Add a byte array as a value to be written out.

In this article
Back to top Generated by DocFX