UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

26 lines (25 loc) 924 B
import { _Sha1 } from '../encryptors/secureHash-algorithm1'; /** * Helper that computes and stores a subject key identifier (SHA-1 of the public key). * * @private */ var _PdfSubjectKeyIdentifier = /** @class */ (function () { function _PdfSubjectKeyIdentifier(info) { this._bytes = this._generateKeyID(info); } /** * Compute the key identifier as SHA-1 over the subject public key bytes. * * @private * @param {_PdfPublicKeyInformation} info - Subject public key information. * @returns {Uint8Array} SHA-1 digest bytes representing the key identifier. */ _PdfSubjectKeyIdentifier.prototype._generateKeyID = function (info) { var sha1 = new _Sha1(); var publicKeyBytes = info._publicKey._data; return sha1._hash(publicKeyBytes, 0, publicKeyBytes.length); }; return _PdfSubjectKeyIdentifier; }()); export { _PdfSubjectKeyIdentifier };