VirtualAuthenticator Class
A software authenticator (https://w3c.github.io/webauthn/#virtual-authenticators): it creates and stores public key credential sources, and signs the assertions with them. Its credentials can be added, listed and removed by the application, as with the WebDriver extension commands.
public sealed class VirtualAuthenticatorRemarks
The authenticator can be used from any thread.
Properties
| Name | Description |
|---|---|
| DefaultBackupEligibility | Gets the default backup eligibility of the credentials that the authenticator creates. |
| DefaultBackupState | Gets the default backup state of the credentials that the authenticator creates. |
| Extensions | Gets the authenticator extensions that the authenticator supports. |
| HasResidentKey | Gets whether the authenticator can store client-side discoverable credentials. |
| HasUserVerification | Gets whether the authenticator can perform user verification. |
| Id | Gets the id of the authenticator (https://w3c.github.io/webauthn/#authenticatorid). |
| IsUserConsenting | Gets or sets whether the user consents to the operations of the authenticator. |
| IsUserVerified | Gets or sets whether the user verification succeeds (https://w3c.github.io/webauthn/#set-user-verified). |
| Protocol | Gets the protocol of the authenticator. |
| Transport | Gets the transport of the authenticator. |
DefaultBackupEligibility
VirtualAuthenticators.csDefaultBackupState
VirtualAuthenticators.csExtensions
VirtualAuthenticators.csGets the authenticator extensions that the authenticator supports.
public IReadOnlyList<string> Extensions { get; }Property value
HasResidentKey
VirtualAuthenticators.csHasUserVerification
VirtualAuthenticators.csIsUserConsenting
VirtualAuthenticators.csIsUserVerified
VirtualAuthenticators.csProtocol
VirtualAuthenticators.csGets the protocol of the authenticator.
public VirtualAuthenticatorProtocol Protocol { get; }Property value
Transport
VirtualAuthenticators.csMethods
| Name | Description |
|---|---|
| AddCredential(VirtualCredential) | Adds a credential to the authenticator (https://w3c.github.io/webauthn/#add-credential). A discoverable credential of the same RP ID and user handle replaces the existing one. |
| GetCredentials() | Returns a snapshot of the credentials of the authenticator (https://w3c.github.io/webauthn/#get-credentials). |
| RemoveAllCredentials() | Removes all the credentials (https://w3c.github.io/webauthn/#remove-all-credentials). |
| RemoveCredential(ReadOnlySpan<byte>) | Removes a credential (https://w3c.github.io/webauthn/#remove-credential). Returns false when the authenticator has no credential with this id. |
| SetCredentialProperties(ReadOnlySpan<byte>, bool?, bool?) | Sets the properties of a credential (https://w3c.github.io/webauthn/#set-credential-properties): the null values are not changed. Returns false when the authenticator has no credential with this id. |
| SetSignCount(ReadOnlySpan<byte>, uint?) | Sets the signature counter of a credential (https://w3c.github.io/webauthn/#set-credential-properties): null removes the counter. Returns false when the authenticator has no credential with this id. |
AddCredential(VirtualCredential)
VirtualAuthenticators.csAdds a credential to the authenticator (https://w3c.github.io/webauthn/#add-credential). A discoverable credential of the same RP ID and user handle replaces the existing one.
public void AddCredential(VirtualCredential credential)Parameters
credentialVirtualCredential
Exceptions
ArgumentException- The private key is not valid, or the credential is discoverable and the authenticator does not support them or it has no user handle.
GetCredentials()
VirtualAuthenticators.csReturns a snapshot of the credentials of the authenticator (https://w3c.github.io/webauthn/#get-credentials).
public IReadOnlyList<VirtualCredential> GetCredentials()RemoveAllCredentials()
VirtualAuthenticators.csRemoves all the credentials (https://w3c.github.io/webauthn/#remove-all-credentials).
public void RemoveAllCredentials()RemoveCredential(ReadOnlySpan<byte>)
VirtualAuthenticators.csRemoves a credential (https://w3c.github.io/webauthn/#remove-credential). Returns false when the authenticator has no credential with this id.
public bool RemoveCredential(ReadOnlySpan<byte> credentialId)SetCredentialProperties(ReadOnlySpan<byte>, bool?, bool?)
VirtualAuthenticators.csSets the properties of a credential (https://w3c.github.io/webauthn/#set-credential-properties): the null values are not changed. Returns false when the authenticator has no credential with this id.
public bool SetCredentialProperties(ReadOnlySpan<byte> credentialId, bool? backupEligibility, bool? backupState)Parameters
credentialIdReadOnlySpan<byte>- The id of the credential.
backupEligibilitybool?- The backup eligibility, or null.
backupStatebool?- The backup state, or null.
Returns
SetSignCount(ReadOnlySpan<byte>, uint?)
VirtualAuthenticators.csSets the signature counter of a credential (https://w3c.github.io/webauthn/#set-credential-properties): null removes the counter. Returns false when the authenticator has no credential with this id.
public bool SetSignCount(ReadOnlySpan<byte> credentialId, uint? signCount)