UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

49 lines 2.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordEncrypt = void 0; class PasswordEncrypt { constructor(data) { let encryptionKeyDefault = "RC4_128"; this.encryptionKey = typeof (data === null || data === void 0 ? void 0 : data.encryptionKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.encryptionKey : encryptionKeyDefault; let openDefault = ""; this.open = typeof (data === null || data === void 0 ? void 0 : data.open) !== "undefined" ? data === null || data === void 0 ? void 0 : data.open : openDefault; let permissionDefault = ""; this.permission = typeof (data === null || data === void 0 ? void 0 : data.permission) !== "undefined" ? data === null || data === void 0 ? void 0 : data.permission : permissionDefault; } static getEncryptionKeyDefault() { return "RC4_128"; } static getEncryptionKeyDescription() { return "Sets the encryption level for the document.\n\n* RC4\\_40 = 40-bit RC4\n* RC4\\_128 = 128-bit RC4\n* AES\\_128 = 128-bit AES\n* AES\\_256 = 256-bit AES\n\n**Important:** Please note that the option \"256-bit AES\" only works if the \"Java Cryptography Extension (JCE)\" has been enabled with \"Unlimited Strength\" in the JVM. You can obtain the modified \"Policy Files\" (along with instructions for installation) from the Oracle website: Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 Download: http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jce-7-download-432124.html"; } static getOpenDefault() { return ""; } static getOpenDescription() { return "Used to set the password that will be requested if the PDF document is opened for reading."; } static getPermissionDefault() { return ""; } static getPermissionDescription() { return "Used to set the password that will be requested if the file is opened for editing (e.g., when removing pages). The password is required to enable the individual access permissions and must not be blank if the access permissions are to be used.\n\n**Important:** Please note that the password and the associated access permissions will only provide protection if an appropriate display program for PDF documents takes these settings into account."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new PasswordEncrypt(data); } toJson() { return { 'encryptionKey': this.encryptionKey, 'open': this.open, 'permission': this.permission, }; } clone() { return PasswordEncrypt.fromJson(this.toJson()); } } exports.PasswordEncrypt = PasswordEncrypt; //# sourceMappingURL=PasswordEncrypt.js.map