Namespace: DSInternals.Win32.WebAuthn.Cryptography
Assembly: DSInternals.Win32.WebAuthn.dll
Software-based authenticator that signs WebAuthn requests using a PEM private key file, without requiring a hardware authenticator or the Windows WebAuthn API.
public static class SoftwareAuthenticatorobject ← SoftwareAuthenticator
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
public const int DefaultCredentialIdLength = 32Determines the COSE algorithm that matches the given private key.
public static Algorithm DetectAlgorithm(AsymmetricAlgorithm key)public static AsymmetricAlgorithm GenerateKeyPair(Algorithm algorithm)algorithm Algorithm
Generates a private key for the requested COSE algorithm and exports it as PKCS#8 PEM.
public static string GenerateKeyPairPem(Algorithm algorithm)algorithm Algorithm
GetAssertion(string, byte[], Algorithm, uint, AuthenticatorFlags, byte[], byte[]?, AsymmetricAlgorithm, AuthenticatorAttachment)
Builds a complete assertion response signed with the given private key.
public static AssertionPublicKeyCredential GetAssertion(string relyingPartyId, byte[] challenge, Algorithm algorithm, uint signatureCounter, AuthenticatorFlags flags, byte[] credentialId, byte[]? userHandle, AsymmetricAlgorithm privateKey, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any)relyingPartyId string
challenge byte[]
algorithm Algorithm
signatureCounter uint
flags AuthenticatorFlags
credentialId byte[]
userHandle byte[]?
privateKey AsymmetricAlgorithm
authenticatorAttachment AuthenticatorAttachment
GetAssertion(string, string?, byte[], Algorithm, uint, AuthenticatorFlags, byte[], byte[]?, AsymmetricAlgorithm, AuthenticatorAttachment)
Builds a complete assertion response signed with the given private key.
public static AssertionPublicKeyCredential GetAssertion(string hostName, string? relyingPartyId, byte[] challenge, Algorithm algorithm, uint signatureCounter, AuthenticatorFlags flags, byte[] credentialId, byte[]? userHandle, AsymmetricAlgorithm privateKey, AuthenticatorAttachment authenticatorAttachment = AuthenticatorAttachment.Any)hostName string
relyingPartyId string?
challenge byte[]
algorithm Algorithm
signatureCounter uint
flags AuthenticatorFlags
credentialId byte[]
userHandle byte[]?
privateKey AsymmetricAlgorithm
authenticatorAttachment AuthenticatorAttachment
Imports a private key from a PEM string. The caller is responsible for disposing the returned key.
public static AsymmetricAlgorithm ImportPrivateKeyFromPem(string pem)pem string
Imports a private key from DER-encoded PKCS#8 data. The caller is responsible for disposing the returned key.
public static AsymmetricAlgorithm ImportPrivateKeyFromPkcs8(byte[] privateKey)privateKey byte[]
Loads a private key from a PEM file. The caller is responsible for disposing the returned key.
public static AsymmetricAlgorithm LoadPrivateKeyFromPem(string pemFilePath)pemFilePath string
MakeCredential(RelyingPartyInformation, UserInformation, byte[], Algorithm, Guid, uint, AuthenticatorFlags, AsymmetricAlgorithm, byte[]?)
Builds a complete attestation response (packed self-attestation) signed with the given private key.
public static AttestationPublicKeyCredential MakeCredential(RelyingPartyInformation relyingParty, UserInformation user, byte[] challenge, Algorithm algorithm, Guid aaGuid, uint signatureCounter, AuthenticatorFlags flags, AsymmetricAlgorithm privateKey, byte[]? credentialId = null)relyingParty RelyingPartyInformation
user UserInformation
challenge byte[]
algorithm Algorithm
aaGuid Guid
signatureCounter uint
flags AuthenticatorFlags
privateKey AsymmetricAlgorithm
credentialId byte[]?
AttestationPublicKeyCredential
MakeCredential(RelyingPartyInformation, string, UserInformation, byte[], Algorithm, Guid, uint, AuthenticatorFlags, AsymmetricAlgorithm, byte[]?)
Builds a complete attestation response (packed self-attestation) signed with the given private key.
public static AttestationPublicKeyCredential MakeCredential(RelyingPartyInformation relyingParty, string hostName, UserInformation user, byte[] challenge, Algorithm algorithm, Guid aaGuid, uint signatureCounter, AuthenticatorFlags flags, AsymmetricAlgorithm privateKey, byte[]? credentialId = null)relyingParty RelyingPartyInformation
hostName string
user UserInformation
challenge byte[]
algorithm Algorithm
aaGuid Guid
signatureCounter uint
flags AuthenticatorFlags
privateKey AsymmetricAlgorithm
credentialId byte[]?