Skip to content

Commit c86da02

Browse files
committed
Fix autoport issue
DEVSIX-1693
1 parent c0cdaaa commit c86da02

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
@@ -87,7 +87,7 @@ public EncryptionProperties setStandardEncryption(byte[] userPassword, byte[] ow
8787
this.ownerPassword = ownerPassword;
8888
} else {
8989
this.ownerPassword = new byte[16];
90-
new SecureRandom().nextBytes(this.ownerPassword);
90+
randomBytes(this.ownerPassword);
9191
}
9292
this.standardEncryptPermissions = permissions;
9393
this.encryptionAlgorithm = encryptionAlgorithm;
@@ -134,4 +134,8 @@ private void clearEncryption() {
134134
this.userPassword = null;
135135
this.ownerPassword = null;
136136
}
137+
138+
private static void randomBytes(byte[] bytes) {
139+
new SecureRandom().nextBytes(bytes);
140+
}
137141
}

0 commit comments

Comments
 (0)