Beispiel #1
0
 public CTAPCommandMakeCredential(CTAPCommandMakeCredentialParam param, byte[] pinAuth)
 {
     this.param = param;
     if (pinAuth != null)
     {
         this.pinAuth = pinAuth.ToArray();
     }
 }
Beispiel #2
0
        /// <summary>
        /// CTAP-Command MakeCredential use PIN string
        /// </summary>
        public async Task <ResponseMakeCredential> MakeCredentialAsync(CTAPCommandMakeCredentialParam param, string pin)
        {
            byte[] pinAuth = null;
            if (!string.IsNullOrEmpty(pin))
            {
                var token = await ClientPINgetPINTokenAsync(pin);

                if (token.DeviceStatus != DeviceStatus.Ok || token.CTAPResponse == null || token.CTAPResponse.Status != 0)
                {
                    return(new ResponseMakeCredential(token.DeviceStatus, token.CTAPResponse));
                }

                pinAuth = CTAPCommandClientPIN.CreatePinAuth(param.ClientDataHash, token.CTAPResponse.PinToken);
                if (pinAuth == null)
                {
                    return(new ResponseMakeCredential(token.DeviceStatus, token.CTAPResponse));
                }
            }

            var ret = await sendCommandandResponseAsync(new CTAPCommandMakeCredential(param, pinAuth), new CTAPResponseMakeCredential());

            return(new ResponseMakeCredential(ret.devSt, ret.ctapRes));
        }
Beispiel #3
0
        /// <summary>
        /// CTAP-Command MakeCredential use pinAuth
        /// </summary>
        public async Task <ResponseMakeCredential> MakeCredentialAsync(CTAPCommandMakeCredentialParam param, byte[] pinAuth = null)
        {
            var ret = await sendCommandandResponseAsync(new CTAPCommandMakeCredential(param, pinAuth), new CTAPResponseMakeCredential());

            return(new ResponseMakeCredential(ret.devSt, ret.ctapRes));
        }