public override bool Equals(object obj) { if (!(obj is DeviceRegistration)) { return(false); } DeviceRegistration other = (DeviceRegistration)obj; return(KeyHandle.SequenceEqual(other.KeyHandle) && PublicKey.SequenceEqual(other.PublicKey) && AttestationCert.SequenceEqual(other.AttestationCert) && (IsCompromised == other.IsCompromised)); }
public static uint FinishAuthentication(StartedAuthentication startedAuthentication, AuthenticateResponse response, DeviceRegistration deviceRegistration, HashSet <string> facets = null) { ClientData clientData = response.GetClientData(); clientData.CheckContent(AuthenticateTyp, startedAuthentication.Challenge, facets); RawAuthenticateResponse authenticateResponse = RawAuthenticateResponse.FromBase64(response.SignatureData); authenticateResponse.CheckSignature(startedAuthentication.AppId, clientData.AsJson(), deviceRegistration.PublicKey); authenticateResponse.CheckUserPresence(); return(deviceRegistration.CheckAndUpdateCounter(authenticateResponse.Counter)); }
public static StartedAuthentication StartAuthentication(string appId, DeviceRegistration deviceRegistration, byte[] challenge) { return(new StartedAuthentication(challenge.ByteArrayToBase64String(), appId, deviceRegistration.KeyHandle.ByteArrayToBase64String())); }
public static StartedAuthentication StartAuthentication(string appId, DeviceRegistration deviceRegistration) { byte[] challenge = Crypto.GenerateChallenge(); return(StartAuthentication(appId, deviceRegistration, challenge)); }