Skip to content

Commit 2cef153

Browse files
committed
Fix autoport issue
DEVSIX-1693
1 parent 51c7897 commit 2cef153

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/EncryptionProperties.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public EncryptionProperties setStandardEncryption(byte[] userPassword, byte[] ow
8686
this.ownerPassword = ownerPassword;
8787
} else {
8888
this.ownerPassword = new byte[16];
89-
new SecureRandom().nextBytes(this.ownerPassword);
89+
randomBytes(this.ownerPassword);
9090
}
9191
this.standardEncryptPermissions = permissions;
9292
this.encryptionAlgorithm = encryptionAlgorithm;
@@ -133,4 +133,8 @@ private void clearEncryption() {
133133
this.userPassword = null;
134134
this.ownerPassword = null;
135135
}
136+
137+
private static void randomBytes(byte[] bytes) {
138+
new SecureRandom().nextBytes(bytes);
139+
}
136140
}

0 commit comments

Comments
 (0)