using System.Text.Json.Serialization; using ProtonVPN.OperatingSystems.WebAuthn.Enums; namespace ProtonVPN.OperatingSystems.WebAuthn; /// /// Contains WebAuthn extensions that are actually supported by Windows 10. /// These are currently defined in CTAP 2.1 Draft. /// public class AuthenticationExtensionsClientOutputs { /// /// This extension is used by the platform to retrieve a symmetric secret from the authenticator when it needs to encrypt or decrypt data using that symmetric secret. This symmetric secret is scoped to a credential. The authenticator and the platform each only have the part of the complete secret to prevent offline attacks. This extension can be used to maintain different secrets on different machines. /// /// https://fidoalliance.org/specs/fido2/fido-client-to-authenticator-protocol-v2.1-rd-20191217.html#sctn-hmac-secret-extension [JsonPropertyName("hmacCreateSecret")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public bool HmacSecret { get; set; } /// /// This extension indicates that the authenticator supports enhanced protection mode for the credentials created on the authenticator. /// If present, verify that the credentialProtectionPolicy value is one of following values: userVerificationOptional, userVerificationOptionalWithCredentialIDList, userVerificationRequired /// /// https://fidoalliance.org/specs/fido2/fido-client-to-authenticator-protocol-v2.1-rd-20191217.html#sctn-credProtect-extension [JsonPropertyName("credentialProtectionPolicy")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public UserVerification CredProtect { get; set; } /// /// HMAC Secret Extension /// /// This extension is only applicable during credential creation. /// https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension [JsonPropertyName("hmacGetSecret")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public HMACGetSecretOutput HmacGetSecret { get; set; } [JsonPropertyName("minPinLength")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public uint? MinimumPinLength { get; set; } [JsonPropertyName("credBlob")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public bool CredentialBlobCreated { get; set; } }