utils

package
v0.0.0-...-48b6be6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B2S

func B2S(b []byte) string

B2S convert byte slice to string.

func BytesBuilder

func BytesBuilder(ptr *byte, len uint32) (buf []byte)

BytesBuilder converts PBYTE to go []byte.

func CreateCancelID

func CreateCancelID() (windows.GUID, error)

CreateCancelID returns a new windows guid

func CreateChallenge

func CreateChallenge(len int) (string, error)

CreateChallenge generates a new chanllenge that will be sent to the authenticator.

In order to prevent replay attacks, the challenges MUST contain enough entropy to make guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long. See https://w3c.github.io/webauthn/#sctn-cryptographic-challenges

Default 32 bytes length will be used if the given length is less than 16 or more than 256

Challenge is encoded in base64.

func GetConsoleWindow

func GetConsoleWindow() (hWnd uintptr)

GetConsoleWindow retrieves the window handle used by the console associated with the calling process.

func GetForegroundWindow

func GetForegroundWindow() (hWnd uintptr)

func GetHostWindow

func GetHostWindow() (hWnd uintptr)

GetHostWindow retrieves the window handle used by the foreground window who starts the caliing process.

func S2B

func S2B(s string) (b []byte)

S2B convert string to []byte slice.

func UTF16PtrtoString

func UTF16PtrtoString(p *uint16) string

UTF16PtrtoString converts a pointer to a UTF16 string into a Go string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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