getHashForDocumentRange

abstract fun getHashForDocumentRange(@NonNull range: List<Long>, @NonNull hashAlgorithm: HashAlgorithm): Array<Byte>

Returns the hash of a particular byte range of the document. This method works only on the first source of a compound document, use getHashForDocumentRange if you want to digest other sources.

Return

Digest of the requested document range.

Parameters

range

The byte range of the part of the document that will be hashed. A byte range is an array of pairs (byte offset, length in bytes) that describe the (possibly discontiguous) region of the document that should be hashed. For an already prepared PDF document with a digital signature, you can get this information via getByteRange on signature info retrieved via getSignatureInfo.

hashAlgorithm

The hash algorithm that will be used to generate the hashed data.


abstract fun getHashForDocumentRange(sourceIndex: Int, @NonNull range: List<Long>, @NonNull hashAlgorithm: HashAlgorithm): Array<Byte>

Returns the hash of a particular byte range of the document.

Return

Digest of the requested document range.

Parameters

sourceIndex

Index of document source that should be hashed (valid only for compound documents).

range

The byte range of the part of the document that will be hashed. A byte range is an array of pairs (byte offset, length in bytes) that describe the (possibly discontiguous) region of the document that should be hashed. For an already prepared PDF document with a digital signature, you can get this information via getByteRange on signature info retrieved via getSignatureInfo.

hashAlgorithm

The hash algorithm that will be used to generate the hashed data.