Skip to content

Commit

Permalink
openhab#14 Specify UTF_8 as charset to convert string to byte array
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Oeing <[email protected]>
  • Loading branch information
coeing committed Nov 18, 2020
1 parent 4036f7c commit 1ee3af8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
Expand Down Expand Up @@ -149,7 +150,7 @@ private KeyStore createKeyStore(String keystore, String keystorePassword)
Security.addProvider(new BouncyCastleProvider());
Signature signer = Signature.getInstance("SHA256withRSA", "BC");
signer.initSign(keyPair.getPrivate());
signer.update("Hello OpenHAB".getBytes());
signer.update("Hello OpenHAB".getBytes(StandardCharsets.UTF_8));
signer.sign();

X509Certificate cert = generateClientCertificate(keyPair);
Expand Down

0 comments on commit 1ee3af8

Please sign in to comment.