UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

70 lines 3.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetadataPassword = void 0; class MetadataPassword { constructor(data) { let hasAsymmetricEncryptionDefault = false; this.hasAsymmetricEncryption = typeof (data === null || data === void 0 ? void 0 : data.hasAsymmetricEncryption) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hasAsymmetricEncryption : hasAsymmetricEncryptionDefault; let hasOpenPasswordDefault = false; this.hasOpenPassword = typeof (data === null || data === void 0 ? void 0 : data.hasOpenPassword) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hasOpenPassword : hasOpenPasswordDefault; let hasPermissionPasswordDefault = false; this.hasPermissionPassword = typeof (data === null || data === void 0 ? void 0 : data.hasPermissionPassword) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hasPermissionPassword : hasPermissionPasswordDefault; let keyAlgorithmDefault = "none"; this.keyAlgorithm = typeof (data === null || data === void 0 ? void 0 : data.keyAlgorithm) !== "undefined" ? data === null || data === void 0 ? void 0 : data.keyAlgorithm : keyAlgorithmDefault; let keyLengthDefault = 0; this.keyLength = typeof (data === null || data === void 0 ? void 0 : data.keyLength) !== "undefined" ? data === null || data === void 0 ? void 0 : data.keyLength : keyLengthDefault; } static getHasAsymmetricEncryptionDefault() { return false; } static getHasAsymmetricEncryptionDescription() { return "If this is set to \"true\", the document is asymmetrically encrypted and a matching private key is required to decrypt it. Otherwise the document is symetrically encrypted and requires a password."; } static getHasOpenPasswordDefault() { return false; } static getHasOpenPasswordDescription() { return "If this is set to \"true\", the document is encrypted and requires a password to be opened."; } static getHasPermissionPasswordDefault() { return false; } static getHasPermissionPasswordDescription() { return "If this is set to \"true\", the document has a change protection and a password is required to claim ownership and modify the document."; } static getKeyAlgorithmDefault() { return "none"; } static getKeyAlgorithmDescription() { return "The algorithm used for encryption.\n\n* none = The document is not encrypted.\n* aes = The document has been encrypted using the Advanced Encryption Standard.\n* rc4 = The document has been encrypted using the RC4 cipher."; } static getKeyLengthDefault() { return 0; } static getKeyLengthDescription() { return "The Bit length of the key used for encryption."; } static getKeyLengthMin() { return 0; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new MetadataPassword(data); } toJson() { return { 'hasAsymmetricEncryption': this.hasAsymmetricEncryption, 'hasOpenPassword': this.hasOpenPassword, 'hasPermissionPassword': this.hasPermissionPassword, 'keyAlgorithm': this.keyAlgorithm, 'keyLength': this.keyLength, }; } clone() { return MetadataPassword.fromJson(this.toJson()); } } exports.MetadataPassword = MetadataPassword; //# sourceMappingURL=MetadataPassword.js.map