Skip to content

Latest commit

 

History

History
698 lines (385 loc) · 39.7 KB

DSInternals.Win32.WebAuthn.WebAuthnApi.md

File metadata and controls

698 lines (385 loc) · 39.7 KB

Class WebAuthnApi

Namespace: DSInternals.Win32.WebAuthn
Assembly: DSInternals.Win32.WebAuthn.dll

Windows WebAuthn API

public class WebAuthnApi

Inheritance

objectWebAuthnApi

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Remarks

Requires Windows 10 1903+ to work.

Constructors

WebAuthnApi()

Initializes a new instance of the class.

public WebAuthnApi()

Properties

ApiVersion

Gets the API version information.

public static ApiVersion? ApiVersion { get; }

Property Value

ApiVersion?

Remarks

Indicates the presence of APIs and features.

IsAvailable

Indicates the availability of the WebAuthn API.

public static bool IsAvailable { get; }

Property Value

bool

IsCancellationSupported

Indicates whether operation cancellation is supported by the API.

public bool IsCancellationSupported { get; }

Property Value

bool

IsCredBlobSupported

Indicates the availability of the Credential Blob extension.

public static bool IsCredBlobSupported { get; }

Property Value

bool

Remarks

Support for the credBlob extension was added in V3 API.

IsCredProtectExtensionSupported

Indicates the availability of the Credential Protection extension.

public static bool IsCredProtectExtensionSupported { get; }

Property Value

bool

Remarks

Support for the credProtect extension was added in V2 API.

IsEnterpriseAttestationSupported

Indicates the availability of enterprise attestation.

public static bool IsEnterpriseAttestationSupported { get; }

Property Value

bool

Remarks

Support for the enterprise attestation was added in V3 API.

IsHybridStorageLinkedDataSupported

Indicates the support for linked device data.

public static bool IsHybridStorageLinkedDataSupported { get; }

Property Value

bool

Remarks

Support for linked device data was added in V7 API.

IsLargeBlobSupported

Indicates the availability of the large blobs.

public static bool IsLargeBlobSupported { get; }

Property Value

bool

Remarks

Support for the large blobs was added in V5 API.

IsMinPinLengthSupported

Indicates the availability of the minimum PIN length extension.

public static bool IsMinPinLengthSupported { get; }

Property Value

bool

Remarks

Support for the minPinLength extension was added in V3 API.

IsPlatformCredentialManagementSupported

Indicates the availability of the API for platform credential management.

public static bool IsPlatformCredentialManagementSupported { get; }

Property Value

bool

Remarks

Support for platform credential management was added in V4 API.

IsPrivateBrowserModeIndicatorSupported

Indicates the API can differentiate between browser modes.

public static bool IsPrivateBrowserModeIndicatorSupported { get; }

Property Value

bool

Remarks

Support for the browser mode indicator was added in V5 API.

IsPsuedoRandomFunctionSupported

Indicates the availability of the psuedo-random function (PRF) extension.

public static bool IsPsuedoRandomFunctionSupported { get; }

Property Value

bool

Remarks

Support for the prf extension was added in V6 API.

IsUnsignedExtensionOutputSupported

Indicates the support for unsigned extension outputs.

public static bool IsUnsignedExtensionOutputSupported { get; }

Property Value

bool

Remarks

Support for the unsigned extension outputs was added in V7 API.

IsUserVerifyingPlatformAuthenticatorAvailable

Indicates the availability of user-verifying platform authenticator (e.g. Windows Hello).

public static bool IsUserVerifyingPlatformAuthenticatorAvailable { get; }

Property Value

bool

Methods

AuthenticatorGetAssertion(string, byte[], UserVerificationRequirement, AuthenticatorAttachment, int, IReadOnlyList<PublicKeyCredentialDescriptor>, AuthenticationExtensionsClientInputs, CredentialLargeBlobOperation, byte[], bool, HybridStorageLinkedData, WindowHandle)

Produces an assertion signature representing an assertion by the authenticator that the user has consented to a specific transaction, such as logging in or completing a purchase.

public AuthenticatorAssertionResponse AuthenticatorGetAssertion(string rpId, byte[] challenge, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> allowCredentials = null, AuthenticationExtensionsClientInputs extensions = null, CredentialLargeBlobOperation largeBlobOperation = CredentialLargeBlobOperation.None, byte[] largeBlob = null, bool browserInPrivateMode = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default)

Parameters

rpId string

challenge byte[]

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

timeoutMilliseconds int

allowCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

extensions AuthenticationExtensionsClientInputs

largeBlobOperation CredentialLargeBlobOperation

largeBlob byte[]

browserInPrivateMode bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

Returns

AuthenticatorAssertionResponse

AuthenticatorGetAssertion(string, CollectedClientData, UserVerificationRequirement, AuthenticatorAttachment, int, IReadOnlyList<PublicKeyCredentialDescriptor>, AuthenticationExtensionsClientInputs, CredentialLargeBlobOperation, byte[], bool, HybridStorageLinkedData, WindowHandle)

Produces an assertion signature representing an assertion by the authenticator that the user has consented to a specific transaction, such as logging in or completing a purchase.

public AuthenticatorAssertionResponse AuthenticatorGetAssertion(string rpId, CollectedClientData clientData, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> allowCredentials = null, AuthenticationExtensionsClientInputs extensions = null, CredentialLargeBlobOperation largeBlobOperation = CredentialLargeBlobOperation.None, byte[] largeBlob = null, bool browserInPrivateMode = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default)

Parameters

rpId string

clientData CollectedClientData

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

timeoutMilliseconds int

allowCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

extensions AuthenticationExtensionsClientInputs

largeBlobOperation CredentialLargeBlobOperation

largeBlob byte[]

browserInPrivateMode bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

Returns

AuthenticatorAssertionResponse

AuthenticatorGetAssertionAsync(string, byte[], UserVerificationRequirement, AuthenticatorAttachment, int, IReadOnlyList<PublicKeyCredentialDescriptor>, AuthenticationExtensionsClientInputs, CredentialLargeBlobOperation, byte[], bool, HybridStorageLinkedData, WindowHandle, CancellationToken)

Produces an assertion signature representing an assertion by the authenticator that the user has consented to a specific transaction, such as logging in or completing a purchase.

public Task<AuthenticatorAssertionResponse> AuthenticatorGetAssertionAsync(string rpId, byte[] challenge, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> allowCredentials = null, AuthenticationExtensionsClientInputs extensions = null, CredentialLargeBlobOperation largeBlobOperation = CredentialLargeBlobOperation.None, byte[] largeBlob = null, bool browserInPrivateMode = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default, CancellationToken cancellationToken = default)

Parameters

rpId string

challenge byte[]

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

timeoutMilliseconds int

allowCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

extensions AuthenticationExtensionsClientInputs

largeBlobOperation CredentialLargeBlobOperation

largeBlob byte[]

browserInPrivateMode bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

cancellationToken CancellationToken

Returns

Task<AuthenticatorAssertionResponse>

AuthenticatorGetAssertionAsync(string, CollectedClientData, UserVerificationRequirement, AuthenticatorAttachment, int, IReadOnlyList<PublicKeyCredentialDescriptor>, AuthenticationExtensionsClientInputs, CredentialLargeBlobOperation, byte[], bool, HybridStorageLinkedData, WindowHandle, CancellationToken)

Produces an assertion signature representing an assertion by the authenticator that the user has consented to a specific transaction, such as logging in or completing a purchase.

public Task<AuthenticatorAssertionResponse> AuthenticatorGetAssertionAsync(string rpId, CollectedClientData clientData, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> allowCredentials = null, AuthenticationExtensionsClientInputs extenstions = null, CredentialLargeBlobOperation largeBlobOperation = CredentialLargeBlobOperation.None, byte[] largeBlob = null, bool browserInPrivateMode = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default, CancellationToken cancellationToken = default)

Parameters

rpId string

clientData CollectedClientData

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

timeoutMilliseconds int

allowCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

extenstions AuthenticationExtensionsClientInputs

largeBlobOperation CredentialLargeBlobOperation

largeBlob byte[]

browserInPrivateMode bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

cancellationToken CancellationToken

Returns

Task<AuthenticatorAssertionResponse>

AuthenticatorMakeCredential(PublicKeyCredentialCreationOptions)

Creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key.

public PublicKeyCredential AuthenticatorMakeCredential(PublicKeyCredentialCreationOptions options)

Parameters

options PublicKeyCredentialCreationOptions

Returns

PublicKeyCredential

AuthenticatorMakeCredential(RelyingPartyInformation, UserInformation, byte[], UserVerificationRequirement, AuthenticatorAttachment, bool, Algorithm[], AttestationConveyancePreference, int, IReadOnlyList<PublicKeyCredentialDescriptor>, EnterpriseAttestationType, AuthenticationExtensionsClientInputs, LargeBlobSupport, bool, bool, bool, HybridStorageLinkedData, WindowHandle)

Creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key.

public PublicKeyCredential AuthenticatorMakeCredential(RelyingPartyInformation rpEntity, UserInformation userEntity, byte[] challenge, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, bool requireResidentKey = false, Algorithm[] pubKeyCredParams = null, AttestationConveyancePreference attestationConveyancePreference = AttestationConveyancePreference.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> excludeCredentials = null, EnterpriseAttestationType enterpriseAttestation = EnterpriseAttestationType.None, AuthenticationExtensionsClientInputs extensions = null, LargeBlobSupport largeBlobSupport = LargeBlobSupport.None, bool preferResidentKey = false, bool browserInPrivateMode = false, bool enablePseudoRandomFunction = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default)

Parameters

rpEntity RelyingPartyInformation

userEntity UserInformation

challenge byte[]

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

requireResidentKey bool

pubKeyCredParams Algorithm[]

attestationConveyancePreference AttestationConveyancePreference

timeoutMilliseconds int

excludeCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

enterpriseAttestation EnterpriseAttestationType

extensions AuthenticationExtensionsClientInputs

largeBlobSupport LargeBlobSupport

preferResidentKey bool

browserInPrivateMode bool

enablePseudoRandomFunction bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

Returns

PublicKeyCredential

AuthenticatorMakeCredential(RelyingPartyInformation, UserInformation, CollectedClientData, UserVerificationRequirement, AuthenticatorAttachment, bool, Algorithm[], AttestationConveyancePreference, int, IReadOnlyList<PublicKeyCredentialDescriptor>, EnterpriseAttestationType, AuthenticationExtensionsClientInputs, LargeBlobSupport, bool, bool, bool, HybridStorageLinkedData, WindowHandle)

Creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key.

public PublicKeyCredential AuthenticatorMakeCredential(RelyingPartyInformation rpEntity, UserInformation userEntity, CollectedClientData clientData, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, bool requireResidentKey = false, Algorithm[] pubKeyCredParams = null, AttestationConveyancePreference attestationConveyancePreference = AttestationConveyancePreference.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> excludeCredentials = null, EnterpriseAttestationType enterpriseAttestation = EnterpriseAttestationType.None, AuthenticationExtensionsClientInputs extensions = null, LargeBlobSupport largeBlobSupport = LargeBlobSupport.None, bool preferResidentKey = false, bool browserInPrivateMode = false, bool enablePseudoRandomFunction = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default)

Parameters

rpEntity RelyingPartyInformation

userEntity UserInformation

clientData CollectedClientData

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

requireResidentKey bool

pubKeyCredParams Algorithm[]

attestationConveyancePreference AttestationConveyancePreference

timeoutMilliseconds int

excludeCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

enterpriseAttestation EnterpriseAttestationType

extensions AuthenticationExtensionsClientInputs

largeBlobSupport LargeBlobSupport

preferResidentKey bool

browserInPrivateMode bool

enablePseudoRandomFunction bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

Returns

PublicKeyCredential

AuthenticatorMakeCredentialAsync(RelyingPartyInformation, UserInformation, byte[], UserVerificationRequirement, AuthenticatorAttachment, bool, Algorithm[], AttestationConveyancePreference, int, AuthenticationExtensionsClientInputs, IReadOnlyList<PublicKeyCredentialDescriptor>, EnterpriseAttestationType, LargeBlobSupport, bool, bool, bool, HybridStorageLinkedData, WindowHandle, CancellationToken)

Creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key.

public Task<PublicKeyCredential> AuthenticatorMakeCredentialAsync(RelyingPartyInformation rpEntity, UserInformation userEntity, byte[] challenge, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, bool requireResidentKey = false, Algorithm[] pubKeyCredParams = null, AttestationConveyancePreference attestationConveyancePreference = AttestationConveyancePreference.Any, int timeoutMilliseconds = 60000, AuthenticationExtensionsClientInputs extensions = null, IReadOnlyList<PublicKeyCredentialDescriptor> excludeCredentials = null, EnterpriseAttestationType enterpriseAttestation = EnterpriseAttestationType.None, LargeBlobSupport largeBlobSupport = LargeBlobSupport.None, bool preferResidentKey = false, bool browserInPrivateMode = false, bool enablePseudoRandomFunction = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default, CancellationToken cancellationToken = default)

Parameters

rpEntity RelyingPartyInformation

userEntity UserInformation

challenge byte[]

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

requireResidentKey bool

pubKeyCredParams Algorithm[]

attestationConveyancePreference AttestationConveyancePreference

timeoutMilliseconds int

extensions AuthenticationExtensionsClientInputs

excludeCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

enterpriseAttestation EnterpriseAttestationType

largeBlobSupport LargeBlobSupport

preferResidentKey bool

browserInPrivateMode bool

enablePseudoRandomFunction bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

cancellationToken CancellationToken

Returns

Task<PublicKeyCredential>

AuthenticatorMakeCredentialAsync(RelyingPartyInformation, UserInformation, CollectedClientData, UserVerificationRequirement, AuthenticatorAttachment, bool, Algorithm[], AttestationConveyancePreference, int, IReadOnlyList<PublicKeyCredentialDescriptor>, EnterpriseAttestationType, AuthenticationExtensionsClientInputs, LargeBlobSupport, bool, bool, bool, HybridStorageLinkedData, WindowHandle, CancellationToken)

Creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key.

public Task<PublicKeyCredential> AuthenticatorMakeCredentialAsync(RelyingPartyInformation rpEntity, UserInformation userEntity, CollectedClientData clientData, UserVerificationRequirement userVerificationRequirement, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any, bool requireResidentKey = false, Algorithm[] pubKeyCredParams = null, AttestationConveyancePreference attestationConveyancePreference = AttestationConveyancePreference.Any, int timeoutMilliseconds = 60000, IReadOnlyList<PublicKeyCredentialDescriptor> excludeCredentials = null, EnterpriseAttestationType enterpriseAttestation = EnterpriseAttestationType.None, AuthenticationExtensionsClientInputs extensions = null, LargeBlobSupport largeBlobSupport = LargeBlobSupport.None, bool preferResidentKey = false, bool browserInPrivateMode = false, bool enablePseudoRandomFunction = false, HybridStorageLinkedData linkedDevice = null, WindowHandle windowHandle = default, CancellationToken cancellationToken = default)

Parameters

rpEntity RelyingPartyInformation

userEntity UserInformation

clientData CollectedClientData

userVerificationRequirement UserVerificationRequirement

authenticatorAttachment AuthenticatorAttachment

requireResidentKey bool

pubKeyCredParams Algorithm[]

attestationConveyancePreference AttestationConveyancePreference

timeoutMilliseconds int

excludeCredentials IReadOnlyList<PublicKeyCredentialDescriptor>

enterpriseAttestation EnterpriseAttestationType

extensions AuthenticationExtensionsClientInputs

largeBlobSupport LargeBlobSupport

preferResidentKey bool

browserInPrivateMode bool

enablePseudoRandomFunction bool

linkedDevice HybridStorageLinkedData

windowHandle WindowHandle

cancellationToken CancellationToken

Returns

Task<PublicKeyCredential>

CancelCurrentOperation()

Cancels the WebAuthn operation currently in progress.

public void CancelCurrentOperation()

Remarks

When this operation is invoked by the client in an authenticator session, it has the effect of terminating any AuthenticatorMakeCredential or AuthenticatorGetAssertion operation currently in progress in that authenticator session. The authenticator stops prompting for, or accepting, any user input related to authorizing the canceled operation. The client ignores any further responses from the authenticator for the canceled operation.

DeletePlatformCredential(byte[])

Removes a Public Key Credential Source stored on a Virtual Authenticator.

public static void DeletePlatformCredential(byte[] credentialId)

Parameters

credentialId byte[]

The ID of the credential to be removed.

Exceptions

NotSupportedException

ArgumentNullException

GetPlatformCredentialList(string, bool)

Gets the list of stored credentials.

public static IList<CredentialDetails> GetPlatformCredentialList(string rpId = null, bool browserInPrivateMode = false)

Parameters

rpId string

Optional Id of the relying party that is making the request.

browserInPrivateMode bool

Indicates whether the browser is in private mode.

Returns

IList<CredentialDetails>

Exceptions

NotSupportedException