Skip to content

Commit 0db3abe

Browse files
committed
feature/sdk_java#134 Cleaned up class.
1 parent 887552f commit 0db3abe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/bunq/sdk/security/SecurityUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private static String getPrivateKeyFormattedString(PrivateKey privateKey) {
171171
}
172172

173173
/**
174-
* @param publicKeyString X509 Public Key string
174+
* @param publicKeyString X509 Public Key string
175175
* @param privateKeyString PKCS8 Private Key string
176176
*/
177177
public static KeyPair createKeyPairFromFormattedStrings(String publicKeyString,
@@ -538,10 +538,11 @@ public static Certificate getCertificateFromFile(String path) throws IOException
538538
File certificateFile = new File(path);
539539
if (certificateFile.exists()) {
540540
Certificate certificate = new Certificate();
541-
certificate.setCertificate(FileUtils.readFileToString(certificateFile));
541+
certificate.setCertificate(FileUtils.readFileToString(certificateFile, "UTF-8"));
542542
return certificate;
543+
} else {
544+
throw new FileNotFoundException();
543545
}
544-
throw new FileNotFoundException();
545546
}
546547

547548
private static byte[] getResponseHeadBytes(int code, List<BunqBasicHeader> headers) {

0 commit comments

Comments
 (0)