webauthnwin

package
v0.0.0-...-5c79d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package webauthnwin is wrapper around Windows webauthn API. It loads system webauthn.dll and uses its methods. It supports API versions 1+. API definition: https://github.com/microsoft/webauthn/blob/master/webauthn.h As Windows Webauthn device can be used both Windows Hello and FIDO devices.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PromptPlatformMessage is the message shown before system prompts.
	PromptPlatformMessage = defaultPromptMessage

	// PromptWriter is the writer used for prompt messages.
	PromptWriter io.Writer = os.Stderr
)

Functions

func IsAvailable

func IsAvailable() bool

IsAvailable returns true if Windows webauthn library is available in the system. Typically, a series of checks is performed in an attempt to avoid false positives. See CheckSupport.

func Login

Login implements Login for Windows Webauthn API.

func Register

Register implements Register for Windows Webauthn API.

func ResetPromptPlatformMessage

func ResetPromptPlatformMessage()

ResetPromptPlatformMessage resets PromptPlatformMessage to its original state.

Types

type AuthenticatorAttachment

type AuthenticatorAttachment int
const (
	AttachmentAuto AuthenticatorAttachment = iota
	AttachmentCrossPlatform
	AttachmentPlatform
)

type CheckSupportResult

type CheckSupportResult struct {
	HasCompileSupport  bool
	IsAvailable        bool
	HasPlatformUV      bool
	WebAuthnAPIVersion int
}

CheckSupport is the result from a Windows webauthn support check.

func CheckSupport

func CheckSupport() CheckSupportResult

CheckSupport return information whether Windows Webauthn is supported and information about API version.

type DiagResult

type DiagResult struct {
	Available                           bool
	RegisterSuccessful, LoginSuccessful bool
}

func Diag

func Diag(ctx context.Context) (*DiagResult, error)

Diag runs a few diagnostic commands and returns the result. User interaction is required.

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]byte
}

type LoginOpts

type LoginOpts struct {
	// AuthenticatorAttachment specifies the desired authenticator attachment.
	AuthenticatorAttachment AuthenticatorAttachment
}

LoginOpts groups non-mandatory options for Login.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL