UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

50 lines 2.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EncryptCertificate = void 0; const index_1 = require("./../index"); class EncryptCertificate { constructor(data) { let contentEncryptionDefault = "encryptEverything"; this.contentEncryption = typeof (data === null || data === void 0 ? void 0 : data.contentEncryption) !== "undefined" ? data === null || data === void 0 ? void 0 : data.contentEncryption : contentEncryptionDefault; 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; this.recipient = (data.recipient || []).map(index_1.Recipient.fromJson); } static getContentEncryptionDefault() { return "encryptEverything"; } static getContentEncryptionDescription() { return "Specifies whether certain contents should be treated differently than others during encryption.\n\n* encryptEverything = All contents of the document are encrypted without distinction (if provided by the standard).\n* exposeMetadata = The document's metadata is left unencrypted to make it discoverable by processing programs. (Has an effect only for 128 bit and 256 bit AES)."; } 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 getRecipientDefault() { return []; } static getRecipientDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new EncryptCertificate(data); } toJson() { var _a; return { 'contentEncryption': this.contentEncryption, 'encryptionKey': this.encryptionKey, 'recipient': (_a = this.recipient) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), }; } clone() { return EncryptCertificate.fromJson(this.toJson()); } } exports.EncryptCertificate = EncryptCertificate; //# sourceMappingURL=EncryptCertificate.js.map