Show / Hide Table of Contents

SetAuthProtocol Method

SetAuthProtocol(PinUvAuthProtocolBase)

Overrides the default PIN/UV Auth protocol (which is determined by the YubiKey and SDK).

C#
public void SetAuthProtocol(PinUvAuthProtocolBase authProtocol)

Parameters

Type Name Description
PinUvAuthProtocolBase authProtocol

The PIN/UV auth protocol instance to use for this session class.

Exceptions

Type Condition
ArgumentNullException

The value specified by authProtocol is null.

Remarks

Call this method with an instance of a class that derives PinUvAuthProtocolBase - either PinUvAuthProtocolOne or PinUvAuthProtocolTwo. When called, this method will replace the existing reference stored as AuthProtocol with the one that was passed to this function. The SDK will automatically dispose of the previous protocol if it was the default protocol created by the SDK. Otherwise, it will not. The caller of this function owns the lifetime of any protocol passed into the session - the SDK will not dispose of any user-set auth protocol.

The auth protocol is not remembered across sessions. That is - if you call this method on session A, and later create a session B, the session B will be using the default auth protocol. You would need to call this method on both session instances to override the default behavior.

In this article
Back to top Generated by DocFX