Show / Hide Table of Contents

Encode Method

Encode()

Build the encoding of the data.

C#
public override byte[] Encode()

Returns

byte[]

A new byte array containing the encoded data object.

Overrides

PivDataObject.Encode()

Remarks

Each data object has a defined format. See the User's Manual entry on GET DATA and GET vendor data for descriptions of the formats. This method will build a new byte array containing the data set in the object. This data will generally then be stored on the YubiKey.

Note that this method returns a new byte array, not a reference to an array inside the object. If this array contains any sensitive data, make sure you overwrite it when done with it.

If the object is empty (IsEmpty is true), then this method will return the encoding of no data, which is 0x53 00.

In this article
Back to top Generated by DocFX