Skip to content

Commit a470696

Browse files
committed
Port some missing samples. Add a method to compute user password
1 parent b31652c commit a470696

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/main/java/com/itextpdf/core/pdf/PdfReader.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,4 +1318,12 @@ public void close() throws IOException {
13181318
buffer = null;
13191319
}
13201320
}
1321+
1322+
/**
1323+
* @return byte array of computed user password, or null if not encrypted or no ownerPassword is used.
1324+
*/
1325+
public byte[] computeUserPassword() {
1326+
if (!encrypted || !ownerPasswordUsed) return null;
1327+
return decrypt.computeUserPassword(password);
1328+
}
13211329
}

0 commit comments

Comments
 (0)