[FIX] Защита от дурака (отсутствие библиотек)

This commit is contained in:
Gravita 2021-02-12 20:56:55 +07:00
parent f6d954827e
commit 9084361a38

View file

@ -61,7 +61,13 @@ public static void main(String[] args) throws Exception {
Path privateKeyFile = dir.resolve("private.key");
ECPublicKey publicKey;
ECPrivateKey privateKey;
Security.addProvider(new BouncyCastleProvider());
try {
Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
Security.addProvider(new BouncyCastleProvider());
} catch (ClassNotFoundException ex) {
LogHelper.error("Library BouncyCastle not found! Is directory 'libraries' empty?");
return;
}
CertificateManager certificateManager = new CertificateManager();
try {
certificateManager.readTrustStore(dir.resolve("truststore"));