From 4643b74922162cdb0c7acc06b74f903e8deb0d23 Mon Sep 17 00:00:00 2001 From: "valery.bokov" Date: Sun, 18 Oct 2026 17:00:58 +0200 Subject: [PATCH] simplify PDEncryption.setPerms and getPerms methods --- .../apache/pdfbox/pdmodel/encryption/PDEncryption.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryption.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryption.java index e804241d354..7fa17916821 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryption.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryption.java @@ -592,10 +592,8 @@ public void setStringFilterName(COSName stringFilterName) * Set the Perms entry in the encryption dictionary. * * @param perms A 16 byte array. - * - * @throws IOException If there is an error setting the data. */ - public void setPerms(byte[] perms) throws IOException + public void setPerms(byte[] perms) { dictionary.setItem( COSName.PERMS, new COSString(perms) ); } @@ -604,10 +602,8 @@ public void setPerms(byte[] perms) throws IOException * Get the Perms entry in the encryption dictionary. * * @return A 16 byte array or null if there is no Perms entry. - * - * @throws IOException If there is an error accessing the data. */ - public byte[] getPerms() throws IOException + public byte[] getPerms() { byte[] perms = null; COSString permsCosString = (COSString)dictionary.getDictionaryObject( COSName.PERMS );