public PubKeyCredParam(COSE.Algorithm alg, PublicKeyCredentialType type = PublicKeyCredentialType.PublicKey)
 {
     Type = type;
     Alg  = alg;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create on database the new FIDO2 Key for the user.
 /// </summary>
 public async Task CreateFido2Key(Guid userId, string name, string credentialId, string publicKey, long signatureCounter, PublicKeyCredentialType credentialType, AuthenticatorAttachment authenticatorType, string transports)
 {
     using (var connection = new SqlConnection(ConnectionString))
     {
         await connection.ExecuteAsync(
             $"[{Schema}].[Fido2Key_Create]",
             new
         {
             Id                = CoreHelpers.GenerateComb(),
             UserId            = userId,
             Name              = name,
             CredentialId      = credentialId,
             PublicKey         = publicKey,
             SignatureCounter  = signatureCounter,
             CredentialType    = credentialType,
             AuthenticatorType = authenticatorType,
             Transports        = transports,
             CreationDate      = DateTime.UtcNow
         },
             commandType : CommandType.StoredProcedure);
     }
 }