Aracılığıyla paylaş


WriteProtection.Hash Property

Password Hash.Represents the attribte in schema: w:hash

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<SchemaAttrAttribute(, "hash")> _
Public Property Hash As Base64BinaryValue
    Get
    Set
'Usage
Dim instance As WriteProtection
Dim value As Base64BinaryValue

value = instance.Hash

instance.Hash = value
[SchemaAttrAttribute(, "hash")]
public Base64BinaryValue Hash { get; set; }

Property Value

Type: DocumentFormat.OpenXml.Base64BinaryValue
Returns StringValue.

Remarks

The following information from the ECMA International Standard ECMA-376 can be useful when working with this class.

Specifies the hash value for the password stored with this document. This value shall be compared with the resulting hash value after hashing the user-supplied password using the algorithm specified by the preceding attributes and parent XML element, and if the two values match, the protection shall no longer be enforced.

If this value is omitted, then no password shall be associated with the protection, and it may be turned off without supplying any password.

Consider a WordprocessingML document with the following information stored in one of its protection elements:

<w:… w:cryptAlgorithmClass="hash" 
  w:cryptAlgorithmType="typeAny" 
  w:cryptAlgorithmSid="1"
  w:hash="9oN7nWkCAyEZib1RomSJTjmPpCY=" />

The hash attribute value of 9oN7nWkCAyEZib1RomSJTjmPpCY= specifies that the user-supplied password shall be hashed using the pre-processing defined by the parent element (if any) followed by the SHA-1 algorithm (specified via the cryptAlgorithmSid attribute value of 1) and that the resulting has value must be 9oN7nWkCAyEZib1RomSJTjmPpCY= for the protection to be disabled.

The possible values for this attribute are defined by the XML Schema base64Binary data type.

See Also

Reference

WriteProtection Class

WriteProtection Members

DocumentFormat.OpenXml.Wordprocessing Namespace