public void Validate()
        {
            if (UserPublicKey == null)
            {
                throw new InvalidOperationException("UserPublicKey is missing in " + typeof(FidoRegistrationData).Name);
            }

            if (KeyHandle == null)
            {
                throw new InvalidOperationException("KeyHandle is missing in " + typeof(FidoRegistrationData).Name);
            }

            if (Signature == null)
            {
                throw new InvalidOperationException("Signature is missing in " + typeof(FidoRegistrationData).Name);
            }

            if (AttestationCertificate == null)
            {
                throw new InvalidOperationException("AttestationCertificate is missing in " + typeof(FidoRegistrationData).Name);
            }

            UserPublicKey.Validate();
            KeyHandle.Validate();
            Signature.Validate();
            AttestationCertificate.Validate();
        }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (UserPublicKey != null ? UserPublicKey.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (KeyHandle != null ? KeyHandle.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AttestationCertificate != null ? AttestationCertificate.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Signature != null ? Signature.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = EnrollmentTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (Transports != null ? Transports.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (KeyHandle != null ? KeyHandle.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PublicKey != null ? PublicKey.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AttestationCertificate != null ? AttestationCertificate.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Counter;
         return(hashCode);
     }
 }