RegisterCommand Class
Namespace: Yubico.YubiKey.U2f.Commands Assembly: Yubico.YubiKey.dllCreates a U2F registration on the device.
C#
public sealed class RegisterCommand : U2fBufferCommand, IYubiKeyCommand<RegisterResponse>
Implements
Remarks
The partner Response class is RegisterResponse.
This command will generally initially return a ConditionsNotSatisfied and will not return success until the user confirms presence by touching the device. Clients should repeatedly send the command as long as they receive this status.
Example:
IYubiKeyConnection connection = key.Connect(YubiKeyApplication.FidoU2f);
byte[] challenge = new byte[32];
RandomNumberGenerator.Fill(challenge);
byte[] appId = new byte[32];
RandomNumberGenerator.Fill(appId);
RegisterCommand registerCommand = new RegisterCommand(challenge, appId);
RegisterResponse registerResponse;
do
{
registerResponse = fidoConnection.SendCommand(registerCommand);
} while (registerResponse.Status == ResponseStatus.ConditionsNotSatisfied);
RegistrationData data = registerResponse.GetData();
Constructors
Name | Description |
---|---|
RegisterCommand() | Creates an instance of the command. |
RegisterCommand(ReadOnlyMemory<byte>, ReadOnlyMemory<byte>) | Creates an instance of the command with the given client data hash and app ID. |
Methods
Name | Description |
---|---|
CreateResponseForApdu(ResponseApdu) | Creates the corresponding IYubiKeyResponse implementation for the current command. |