Exemplo n.º 1
0
        public ResponseBase(DeviceStatus devst, CTAPResponse ctapres)
        {
            bool check = false;

            if (devst == DeviceStatus.NotConnected)
            {
                // HIDデバイスは権限がないとみつからない
                check = true;
            }
            else if ((ctapres == null || ctapres.Status != 0) && devst == DeviceStatus.Ok)
            {
                // この場合、アプリの権限の問題が怪しい
                check = true;
            }
            // この場合、アプリの権限の問題が怪しい
            if (check)
            {
                if (!Common.IsAdministrator())
                {
                    devst = DeviceStatus.Unauthorized;
                }
            }

            this.DeviceStatus = devst;
        }
Exemplo n.º 2
0
        protected CBORObject decodeFromBytes(byte[] byteresponse)
        {
            CBORObject cbor = null;

            //Bad authenticator response such as communication error
            if (byteresponse == null)
            {
                return(null);
            }

            // Status
            Status    = byteresponse[0];
            StatusMsg = CTAPResponse.GetMessage(Status);

            if (byteresponse.Length > 1)
            {
                try {
                    // CBOR
                    var cobrbyte = byteresponse.Skip(1).ToArray();
                    cbor = CBORObject.DecodeFromBytes(cobrbyte, CBOREncodeOptions.Default);

                    ResponsePayloadJson = cbor.ToJSONString();
                    Logger.Log($"Recv: {ResponsePayloadJson}");
                } catch (Exception ex) {
                    Logger.Log($"CBOR DecordError:{ex.Message}");
                }
            }

            return(cbor);
        }
Exemplo n.º 3
0
 public ResponseMakeCredential(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     if (ctapres is CTAPResponseMakeCredential)
     {
         this.CTAPResponse = ctapres as CTAPResponseMakeCredential;
     }
     else
     {
         this.CTAPResponse = new CTAPResponseMakeCredential(ctapres);
     }
 }
Exemplo n.º 4
0
 public ResponseGetAssertion(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     if (ctapres is CTAPResponseGetAssertion)
     {
         this.CTAPResponse = ctapres as CTAPResponseGetAssertion;
     }
     else
     {
         this.CTAPResponse = new CTAPResponseGetAssertion(ctapres);
     }
 }
Exemplo n.º 5
0
        public CTAPResponse(CTAPResponse obj)
        {
            if (obj == null)
            {
                return;
            }

            Status              = obj.Status;
            StatusMsg           = obj.StatusMsg;
            ResponsePayloadJson = obj.ResponsePayloadJson;
            SendPayloadJson     = obj.SendPayloadJson;
        }
Exemplo n.º 6
0
 public CTAPResponseMakeCredential(CTAPResponse obj) : base(obj)
 {
 }
Exemplo n.º 7
0
 protected abstract Task <(DeviceStatus devSt, CTAPResponse ctapRes)> sendCommandandResponseAsync(CTAPCommand cmd, CTAPResponse res);
Exemplo n.º 8
0
 public CTAPResponseClientPIN_getPINToken(CTAPResponse obj) : base(obj)
 {
 }
Exemplo n.º 9
0
 public CTAPResponseClientPIN(CTAPResponse obj) : base(obj)
 {
 }
Exemplo n.º 10
0
 public CTAPResponseGetAssertion(CTAPResponse obj) : base(obj)
 {
 }
Exemplo n.º 11
0
 public ResponseClientPIN_getKeyAgreement(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     this.CTAPResponse = ctapres as CTAPResponseClientPIN2_getKeyAgreement;
 }
Exemplo n.º 12
0
 public ResponseClientPIN_getRetries(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     this.CTAPResponse = ctapres as CTAPResponseClientPIN_getRetries;
 }
Exemplo n.º 13
0
 public ResponseGetInfo(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     this.CTAPResponse = ctapres as CTAPResponseGetInfo;
 }
Exemplo n.º 14
0
 public ResponseReset(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     this.CTAPResponse = ctapres;
 }
Exemplo n.º 15
0
 public ResponseClientPIN_getPINToken(DeviceStatus devst, CTAPResponse ctapres, COSE_Key key) : base(devst, ctapres)
 {
     this.KeyAgreementPublicKey = key;
     this.CTAPResponse          = ctapres as CTAPResponseClientPIN_getPINToken;
 }
Exemplo n.º 16
0
 public ResponseClientPIN_getPINToken(DeviceStatus devst, CTAPResponse ctapres) : base(devst, ctapres)
 {
     this.CTAPResponse = ctapres as CTAPResponseClientPIN_getPINToken;
 }