Пример #1
0
 public override string ToString()
 {
     return(string.Format("AAGUID: {0}, CredentialID: {1}, CredentialPublicKey: {2}",
                          AaGuid.ToString(),
                          CredentialID.ToHex(true),
                          CredentialPublicKey.ToString()));
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CredentialID != null)
         {
             hashCode = hashCode * 59 + CredentialID.GetHashCode();
         }
         if (Certificates != null)
         {
             hashCode = hashCode * 59 + Certificates.GetHashCode();
         }
         if (CertInfo != null)
         {
             hashCode = hashCode * 59 + CertInfo.GetHashCode();
         }
         if (AuthInfo != null)
         {
             hashCode = hashCode * 59 + AuthInfo.GetHashCode();
         }
         if (Lang != null)
         {
             hashCode = hashCode * 59 + Lang.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CredentialID != null)
         {
             hashCode = hashCode * 59 + CredentialID.GetHashCode();
         }
         if (Hash != null)
         {
             hashCode = hashCode * 59 + Hash.GetHashCode();
         }
         if (SAD != null)
         {
             hashCode = hashCode * 59 + SAD.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #4
0
        /// <summary>
        /// Returns true if InputCredentialsExtendTransaction instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsExtendTransaction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsExtendTransaction other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     Hash == other.Hash ||
                     Hash != null &&
                     Hash.Equals(other.Hash)
                 ) &&
                 (
                     SAD == other.SAD ||
                     SAD != null &&
                     SAD.Equals(other.SAD)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
 public override string ToString()
 {
     return(string.Format("AAGUID: {0}, CredentialID: {1}, CredentialPublicKey: {2}",
                          AaGuid.ToString(),
                          CredentialID.ToString().Replace("-", ""),
                          CredentialPublicKey.ToString()));
 }
Пример #6
0
        /// <summary>
        /// Returns true if InputCredentialsAuthorize instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsAuthorize to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsAuthorize other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     NumSignatures == other.NumSignatures ||
                     NumSignatures != null &&
                     NumSignatures.Equals(other.NumSignatures)
                 ) &&
                 (
                     Hash == other.Hash ||
                     Hash != null &&
                     Hash.Equals(other.Hash)
                 ) &&
                 (
                     PIN == other.PIN ||
                     PIN != null &&
                     PIN.Equals(other.PIN)
                 ) &&
                 (
                     OTP == other.OTP ||
                     OTP != null &&
                     OTP.Equals(other.OTP)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
Пример #7
0
        /// <summary>
        /// Returns true if InputSignaturesSignhash instances are equal
        /// </summary>
        /// <param name="other">Instance of InputSignaturesSignhash to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputSignaturesSignhash other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     SAD == other.SAD ||
                     SAD != null &&
                     SAD.Equals(other.SAD)
                 ) &&
                 (
                     Hash == other.Hash ||
                     Hash != null &&
                     Hash.Equals(other.Hash)
                 ) &&
                 (
                     HashAlgo == other.HashAlgo ||
                     HashAlgo != null &&
                     HashAlgo.Equals(other.HashAlgo)
                 ) &&
                 (
                     SignAlgo == other.SignAlgo ||
                     SignAlgo != null &&
                     SignAlgo.Equals(other.SignAlgo)
                 ) &&
                 (
                     SignAlgoParams == other.SignAlgoParams ||
                     SignAlgoParams != null &&
                     SignAlgoParams.Equals(other.SignAlgoParams)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
        /// <summary>
        /// Returns true if InputCredentialsInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     Certificates == other.Certificates ||
                     Certificates != null &&
                     Certificates.Equals(other.Certificates)
                 ) &&
                 (
                     CertInfo == other.CertInfo ||
                     CertInfo != null &&
                     CertInfo.Equals(other.CertInfo)
                 ) &&
                 (
                     AuthInfo == other.AuthInfo ||
                     AuthInfo != null &&
                     AuthInfo.Equals(other.AuthInfo)
                 ) &&
                 (
                     Lang == other.Lang ||
                     Lang != null &&
                     Lang.Equals(other.Lang)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
Пример #9
0
        protected override void Execute(NativeActivityContext context)
        {
            string spreadsheetId = SpreadsheetId.Get(context);
            GoogleSheetProperty googleSheetProperty;

            switch (AuthenticationType)
            {
            case GoogleAuthenticationType.ApiKey:
                string apiKey = ApiKey.Get(context);
                googleSheetProperty = GoogleSheetProperty.Create(apiKey, spreadsheetId);
                break;

            case GoogleAuthenticationType.OAuth2User:
                string credentialID     = CredentialID.Get(context);
                string credentialSecret = CredentialSecret.Get(context);
                googleSheetProperty = Task.Run(async() =>
                {
                    return(await GoogleSheetProperty.Create(credentialID, credentialSecret, spreadsheetId));
                }).Result;
                break;

            case GoogleAuthenticationType.OAuth2ServiceAccount:
                string serviceAccountEmail = ServiceAccountEmail.Get(context);
                string keyPath             = KeyPath.Get(context);
                string password            = Password.Get(context);
                googleSheetProperty = GoogleSheetProperty.Create(keyPath, password, serviceAccountEmail, spreadsheetId);
                break;

            default:
                googleSheetProperty = GoogleSheetProperty.Create("wrongkey", spreadsheetId);
                break;
            }

            if (Body != null)
            {
                context.ScheduleAction <GoogleSheetProperty>(Body, googleSheetProperty, OnCompleted, OnFaulted);
            }
        }
        /// <summary>
        /// Returns true if InputCredentialsSendOTP instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsSendOTP to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsSendOTP other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
Пример #11
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CredentialID != null)
         {
             hashCode = hashCode * 59 + CredentialID.GetHashCode();
         }
         if (NumSignatures != null)
         {
             hashCode = hashCode * 59 + NumSignatures.GetHashCode();
         }
         if (Hash != null)
         {
             hashCode = hashCode * 59 + Hash.GetHashCode();
         }
         if (PIN != null)
         {
             hashCode = hashCode * 59 + PIN.GetHashCode();
         }
         if (OTP != null)
         {
             hashCode = hashCode * 59 + OTP.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }
 public override string ToString()
 {
     return($"AAGUID: {AaGuid}, CredentialID: {CredentialID.ToString().Replace("-", "")}, CredentialPublicKey: {CredentialPublicKey}");
 }