Class AuthenticatorOperationParameters<TOperationParameters>
This abstract class represents a FIDO2 operation that can be performed by
the authenticator. It provides common functionality for managing
parameters associated with the operation,
such as MakeCredential
and GetAssertionParameters
.
MakeCredentialParameters
GetAssertionParameters
public abstract class AuthenticatorOperationParameters<TOperationParameters> : ICborEncode where TOperationParameters : AuthenticatorOperationParameters<TOperationParameters>
Type Parameters
TOperationParameters
- Inheritance
-
objectAuthenticatorOperationParameters<TOperationParameters>
- Implements
- Derived
Properties
Extensions
The list of extensions. This is an optional parameter, so it can be null.
public IReadOnlyDictionary<string, byte[]> Extensions { get; }
Property Value
- IReadOnlyDictionary<string, byte[]>
Remarks
To add an entry to the list, call AddExtension<TValue>(string, TValue).
For each value, the standard (or the vendor in the case of vendor-defined extensions) will define the structure of the value. From that structure the value can be encoded following CBOR rules. The result of the encoding the value is what is stored in this dictionary.
Options
The list of authenticator options. Each standard-defined option is a key/value pair, where the key is a string and the value is a boolean.
public IReadOnlyDictionary<string, bool> Options { get; }
Property Value
- IReadOnlyDictionary<string, bool>
Remarks
To add options, call AddOption(string, bool).
Methods
AddExtension(string, byte[])
Add an entry to the extensions list.
public void AddExtension(string extensionKey, byte[] encodedBytes)
Parameters
extensionKey
stringThe key of key/value to add.
encodedBytes
byte[]The CBOR-encoded value of key/value to add.
Remarks
Each extension is a key/value pair. For each extension the key is a string (such as "credProtect" or "hmac-secret"). However, each value is different. There will be a definition of the value that goes with each key. It will be possible to encode that definition using the rules of CBOR. The caller supplies the key and the encoded value.
Exceptions
- ArgumentNullException
The
extensionKey
orencodedValue
arg is null.
AddExtension<TValue>(string, TValue)
Add an entry to the extensions list.
public void AddExtension<TValue>(string extensionKey, TValue value)
Parameters
extensionKey
stringThe key of key/value to add.
value
TValueThe CBOR-encoded value of key/value to add.
Type Parameters
TValue
Remarks
Each extension is a key/value pair. For each extension the key is a string (such as "credProtect" or "hmac-secret"). However, each value is different.
Exceptions
- ArgumentNullException
The
extensionKey
orencodedValue
arg is null.
AddOption(string, bool)
Add an entry to the list of options.
public void AddOption(string optionKey, bool optionValue)
Parameters
optionKey
stringThe option to add. This is the key of the option key/value pair.
optionValue
boolThe value this option will possess.
Remarks
If the Options
list already contains an entry with the given
optionKey
, this method will replace it.
Note that the standard specifies valid option keys. Currently they are "rk", "up", and "uv". This method will accept any key given and pass it to the YubiKey. If an invalid key is used, the YubiKey will return an error.
Exceptions
- ArgumentNullException
The
optionKey
arg is null.
CborEncode()
Return a new byte array that is the object encoded following the FIDO2/CBOR standard.
public abstract byte[] CborEncode()
Returns
- byte[]
The encoded construct.
Exceptions
- InvalidOperationException
The object contains no data.