Table of Contents

Struct TicketFlags

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

Flags that control the output format of the one-time password.

public struct TicketFlags

Remarks

The output format is controlled by the TicketFlags enumeration. These are binary flags that can be turned on or off. As the YubiKeyDevice functionality has been extended, the usage of these flags have become interleaved to allow full backwards compatibility.

The generalized format of the OTP output string looks like: ref_string <TAB> fixed_string <TAB> OTP_string <TAB> <CR>

Fields

AppendCarriageReturn

Send a carriage return after all other characters.

public const byte AppendCarriageReturn = 32

Field Value

byte

AppendDelayToFixed

Delay .5 second after emitting the fixed string portion.

public const byte AppendDelayToFixed = 8

Field Value

byte

AppendDelayToOtp

Delay .5 second after emitting the OTP string.

public const byte AppendDelayToOtp = 16

Field Value

byte

AppendTabToFixed

Send a tab character after the fixed string.

public const byte AppendTabToFixed = 2

Field Value

byte

AppendTabToOtp

Send a tab character after the OTP string.

public const byte AppendTabToOtp = 4

Field Value

byte

ChallengeResponse

Sets the configuration for challenge response mode, along with other ConfigurationFlags.

public const byte ChallengeResponse = 64

Field Value

byte

Remarks

Note that this flag collides with OathHotp. In order for the YubiKey to consider this flag to be ChallengeResponse instead of OathHotp, either the YubicoOtpChallengeResponse or HmacSha1ChallengeResponse flags need to be set. Failure to do so will result in an OATH HOTP configuration, or an error.

None

No ticket flags are requested for this configuration.

public const byte None = 0

Field Value

byte

OathHotp

Sets the configuration for OATH HOTP combination with other ConfigurationFlags.

public const byte OathHotp = 64

Field Value

byte

Remarks

In order to use OATH HOTP in a slot, neither the YubicoOtpChallengeResponse nor HmacSha1ChallengeResponse flags should be set. If they are, the slot will instead be configured for challenge response, or result in an error.

ProtectLongPressSlot

Locks and/or protects the long-press configuration slot of the YubiKey.

public const byte ProtectLongPressSlot = 128

Field Value

byte

TabFirst

Send an initial tab character before the fixed string.

public const byte TabFirst = 1

Field Value

byte

Methods

ValidateFlagsForUpdate()

Ensure that no flags are set that cannot be used to update an existing configuration.

public void ValidateFlagsForUpdate()

Operators

implicit operator TicketFlags(byte)

Implicitly convert a byte to a TicketFlags object.

public static implicit operator TicketFlags(byte b)

Parameters

b byte

A byte containing the flags.

Returns

TicketFlags

implicit operator byte(TicketFlags)

Implicitly convert TicketFlags to a byte.

public static implicit operator byte(TicketFlags flags)

Parameters

flags TicketFlags

Flag object to convert.

Returns

byte