Show / Hide Table of Contents

GetData Method

GetData()

Gets the public key from the YubiKey response.

C#
public PivPublicKey GetData()

Returns

PivPublicKey

The public key as a PivPublicKey (or subclass: PivRsaPublicKey or PivEccPublicKey) object.

Implements

IYubiKeyResponseWithData<TData>.GetData()

Exceptions

Type Condition
InvalidOperationException

Thrown when Status is not Success.

Remarks

Note that if there is no data to return, this method will throw an exception. Even if the response indicates AuthenticationRequired (see the Status property), which means the process was not completed because the wrong or no PIN was entered, or the YubiKey was not touched within the time period. That is, it is not an error, the process is simply incomplete. Nonetheless, in that case the method will throw an exception. Hence, do not call this method unless you know that Status is Success.

In This Article
  • Remarks
Back to top Generated by DocFX