SignatureProvider.HashStream method (Office)

Allows a signature provider add-in to create a hash value for the document that you can use to determine if the document contents were tampered with after digital signing.

Syntax

expression.HashStream(QueryContinue, Stream)

expression An expression that returns a SignatureProvider object.

Parameters

Name Required/Optional Data type Description
QueryContinue Required IQueryContinue Provides a way to query the host application for permission to continue the hashing process.
Stream Required IStream Contains the data stream.

Return value

Byte

Remarks

The SignatureProvider object is used exclusively in custom signature provider add-ins. This method is called once per signature data stream in a document. The return value is an array of bytes representing the hash value computed by using the hash algorithm.

Example

The following example gets the hash value of a data stream.

 public Array HashStream(object queryContinue, object stream) 
 { 
 using (COMStream comstream = new COMStream(stream)) 
 { 
 using (HashAlgorithm hashalg = HashAlgorithm.Create(this.HashAlgorithmName)) 
 { 
 return hashalg.ComputeHash(comstream); 
 } 
 } 
 } 

Note

Signature providers are implemented exclusively in custom COM add-ins and cannot be implemented in Microsoft Visual Basic for Applications (VBA).

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.