mirror of
https://github.com/bitwarden/mobile
synced 2026-01-10 20:43:41 +00:00
[PM-5731] feat: implement get assertion params object
This commit is contained in:
9
src/Core/Abstractions/IFido2AuthenticatorService.cs
Normal file
9
src/Core/Abstractions/IFido2AuthenticatorService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Bit.Core.Utilities.Fido2;
|
||||
|
||||
namespace Bit.Core.Abstractions
|
||||
{
|
||||
public interface IFido2AuthenticatorService
|
||||
{
|
||||
Task<Fido2AuthenticatorGetAssertionResult> GetAssertionAsync(Fido2AuthenticatorGetAssertionParams assertionParams);
|
||||
}
|
||||
}
|
||||
18
src/Core/Services/Fido2AuthenticatorService.cs
Normal file
18
src/Core/Services/Fido2AuthenticatorService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Utilities.Fido2;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class Fido2AuthenticatorService : IFido2AuthenticatorService
|
||||
{
|
||||
public Task<Fido2AuthenticatorGetAssertionResult> GetAssertionAsync(Fido2AuthenticatorGetAssertionParams assertionParams)
|
||||
{
|
||||
// TODO: IMPLEMENT this
|
||||
return Task.FromResult(new Fido2AuthenticatorGetAssertionResult
|
||||
{
|
||||
AuthenticatorData = new byte[32],
|
||||
Signature = new byte[8]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,21 @@
|
||||
{
|
||||
public class Fido2AuthenticatorGetAssertionParams
|
||||
{
|
||||
/** The caller’s RP ID, as determined by the user agent and the client. */
|
||||
public string RpId { get; set; }
|
||||
|
||||
public string CredentialId { get; set; }
|
||||
/** The hash of the serialized client data, provided by the client. */
|
||||
public byte[] Hash {get; set;}
|
||||
|
||||
public string Counter { get; set; }
|
||||
public PublicKeyCredentialDescriptor[] AllowCredentialDescriptorList {get; set;}
|
||||
|
||||
/** The effective user verification requirement for assertion, a Boolean value provided by the client. */
|
||||
public bool RequireUserVerification {get; set;}
|
||||
|
||||
/** CTAP2 authenticators support setting this to false, but we only support the WebAuthn authenticator model which does not have that option. */
|
||||
// public bool RequireUserPresence {get; set;} // Always required
|
||||
|
||||
public object Extensions {get; set;}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Bit.Core.Utilities.Fido2
|
||||
{
|
||||
public class PublicKeyCredentialDescriptor {
|
||||
public byte[] Id {get; set;}
|
||||
public string[] Transports;
|
||||
public string Type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user