/// <summary> /// Creates a hashable file, computes the hash and signature immediately /// </summary> public HashableFile(string FilePath, HashProvider Provider, Cert SigningCert) { _filePath = FilePath; this.ComputeHash(Provider, SigningCert); }
public void ComputeHash(HashProvider Provider, Cert SigningCert) { ComputedHash = Hash.Compute(GetHashableStream(), Provider, SigningCert); }
public bool Verify(Cert SigningPublicCert) { string n = null; return(ComputedHash.Verify(GetHashableStream(), out n, SigningPublicCert)); }
/// <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(GetHashableStream(), out Reason, SigningPublicCert)); }
/// <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(HashProvider Provider, Cert SigningCert = null) { ComputedHash = Hash.Compute(GetHashableData(), Provider, SigningCert); }