Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-saslprep</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdftest</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/itextpdf/rups/model/PdfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This file is part of the iText (R) project.
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.ReaderProperties;
import com.itextpdf.passwordprep.PdfPasswordUtil;

import javax.swing.*;
import java.io.*;
Expand Down Expand Up @@ -137,8 +138,8 @@ public void selectInitialValue() {

pane.createDialog(null, "Enter the User or Owner Password of this PDF file").setVisible(true);

// TODO RES-427: SASLprep & truncate this
return new String(passwordField.getPassword()).getBytes(StandardCharsets.UTF_8);
String passwordString = new String(passwordField.getPassword());
return PdfPasswordUtil.preparePasswordForOpen(passwordString);
}

/**
Expand Down