Show / Hide Table of Contents

SlotAccessCode Class

Namespace: Yubico.YubiKey.Otp Assembly: Yubico.YubiKey.dll

Container for a YubiKey OTP Slot access code.

C#
public class SlotAccessCode
Inheritance object SlotAccessCode

Remarks

Access codes must be exactly six bytes when used in the YubiKey protocol. This helper-class assures that the access code does not exceed the maximum length, and pads the code with zeros (0x00) if less than six bytes are specified.

This class has an explicit operator that allows you to cast a byte array as a SlotAccessCode if that is more convenient than constructing one.

Constructors

Name Description
SlotAccessCode()

Constructs a SlotAccessCode instance with an empty (all zeros) code.

SlotAccessCode(ReadOnlyMemory<byte>)

Constructs a SlotAccessCode instance using the bytes in the collection.

Fields

Name Description
MaxAccessCodeLength

Constant giving a reference to the maximum length of an access code.

Operators

Name Description
explicit operator SlotAccessCode(byte[])

Explicit operator to allow a byte array to be used as a parameter for methods expecting a SlotAccessCode instance.

In This Article
  • Remarks
    • Constructors
    • Fields
    • Operators
Back to top Generated by DocFX