Show / Hide Table of Contents

VerifyTemporaryPinCommand Class

Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dll

Verify the PIV Bio temporary PIN.

C#
public sealed class VerifyTemporaryPinCommand : IYubiKeyCommand<VerifyTemporaryPinResponse>
Inheritance object VerifyTemporaryPinCommand
Implements
IYubiKeyCommand<VerifyTemporaryPinResponse>

Remarks

The partner Response class is VerifyTemporaryPinResponse.

When using biometric verification, clients can request a temporary PIN by calling VerifyUvCommand with requestTemporaryPin=true.

Example:

/* This example assumes the application has a method to collect a PIN.
*/
IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
/* request temporary PIN */
var verifyUvCommand = new VerifyUvCommand(true, false);
/* a biometric verification will be performed */
var verifyUvResponse = connection.SendCommand(verifyUvCommand);
if (verifyUvResponse.Status == ResponseStatus.Success) 
{
  var temporaryPin = verifyUvResponse.GetData();
  /* using temporary PIN will not request biometric verification */
  var verifyTemporaryPinCommand = new VerifyTemporaryPin(temporaryPin);
  var verifyResponse = connection.SendCommand(verifyTemporaryPinCommand);
  if (verifyResponse == ResponseStatus.Success) 
  {
      /* session is authenticated */
  }
}

Constructors

Name Description
VerifyTemporaryPinCommand(ReadOnlyMemory<byte>)

Initializes a new instance of the VerifyTemporaryPinCommand class which will use the given temporary PIN.

Properties

Name Description
Application

Gets the YubiKeyApplication to which this command belongs. For this command it's PIV.

Methods

Name Description
CreateCommandApdu()

Creates a well-formed CommandApdu to send to the YubiKey.

CreateResponseForApdu(ResponseApdu)

Creates the corresponding IYubiKeyResponse implementation for the current command.

In this article
Back to top Generated by DocFX