第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

iTextPdf setEncryption 沒有權(quán)限

iTextPdf setEncryption 沒有權(quán)限

守著一只汪 2021-08-04 17:18:34
我用這樣的密碼加密pdf:public static void main(String[] args) throws DocumentException, MalformedURLException, IOException {    Document document = new Document();    PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("zrsz.pdf"));    writer.setEncryption("ownerPass".getBytes(), "userPass".getBytes(), PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128);        writer.createXmpMetadata();        document.open();        document.add(new Paragraph("This is create PDF with Password demo."));    document.close();    System.out.println("Done");   }但我找不到給這個setEncryption方法一個“無權(quán)限”參數(shù)的方法:public void setEncryption(byte[] userPassword,                          byte[] ownerPassword,                          int permissions,                          int encryptionType)甚至有可能嗎?我想將該文件的訪問權(quán)限限制在最低限度。我只是用它來讀取機密數(shù)據(jù)。提前致謝 !
查看完整描述

1 回答

?
犯罪嫌疑人X

TA貢獻(xiàn)2080條經(jīng)驗 獲得超4個贊

根據(jù)手冊,您可以使用文檔所說的以下所有內(nèi)容

設(shè)置此文檔的加密選項。userPassword 和 ownerPassword 可以為 null 或長度為零。在這種情況下,ownerPassword 被隨機字符串替換。文檔的打開權(quán)限可以是 AllowPrinting、AllowModifyContents、AllowCopy、AllowModifyAnnotations、AllowFillIn、AllowScreenReaders、AllowAssembly 和 AllowDegradedPrinting

使用用戶密碼打開文檔時允許上述所有操作。所以你有一個安全措施,只有輸入有效憑據(jù)(密碼)的用戶才能操作它。


查看完整回答
反對 回復(fù) 2021-08-04
  • 1 回答
  • 0 關(guān)注
  • 466 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號