예제 #1
0
 /// <summary>
 /// Verifies the hash and signature of an object
 /// </summary>
 /// <param name="SigningPublicCert"></param>
 /// <returns>Returns TRUE if the hash and signature verify correctly</returns>
 public bool Verify(Cert SigningPublicCert, out string Reason)
 {
     return(ComputedHash.Verify(GetHashableData(), out Reason, SigningPublicCert));
 }
예제 #2
0
        public bool Verify(Cert SigningPublicCert)
        {
            string n = null;

            return(ComputedHash.Verify(GetHashableData(), out n, SigningPublicCert));
        }
예제 #3
0
        /// <summary>
        /// Computes a hash from a string
        /// </summary>
        /// <param name="FromString">The string to hash</param>
        /// <param name="Provider">The provider to hash with</param>
        /// <param name="SigningCert">Optional cert to sign with</param>
        /// <returns>A new Hash object</returns>
        public static Hash Compute(string FromString, HashProvider Provider, Cert SigningCert = null)
        {
            UnicodeEncoding UE = new UnicodeEncoding();

            return(Compute(UE.GetBytes(FromString), Provider, SigningCert));
        }
예제 #4
0
 /// <summary>
 /// Compute a hash for this object and optionally signs it
 /// </summary>
 /// <param name="Provider">The hash provider to use</param>
 /// <param name="SigningCert">If provided the cert to sign the hash with</param>
 public void ComputeHash(Hash.HashProvider Provider, Cert SigningCert = null)
 {
     ComputedHash = Hash.Compute(GetHashableData(), Provider, SigningCert);
 }
예제 #5
0
        /// <summary>
        /// Checks if the hash is structurally valid, does not validate the actual hash
        /// </summary>
        public bool HashLengthValid(Cert SigningCert = null)
        {
            var r = "";

            return(HashLengthValid(out r, SigningCert));
        }