Commit f87d1388 authored by j.hoerdt's avatar j.hoerdt
Browse files

add configuration for pid reg files

parent 860b6661
csv_directory = /mnt/nfs_root_data/luftdaten/
geocoding_cache = /mnt/nfs_root_data/luftdaten/geocoding_cache
already_uploaded_days_file = /progress/already_uploaded_days.txt
failed_to_upload_sensors_file = /progress/failed_to_upload.txt
\ No newline at end of file
failed_to_upload_sensors_file = /progress/failed_to_upload.txt
pid_reg_server_cert = /handle_auth/pid_reg_server_cert.pem
pid_reg_keystore = /handle_auth/pid_reg_keystore.p12
\ No newline at end of file
......@@ -14,7 +14,7 @@ public class Handle {
private static TrustManager[] get_trust_managers() throws Exception {
var server_self_signed_certificate = CertificateFactory.getInstance("X.509")
.generateCertificate(new FileInputStream("server_cert"));
.generateCertificate(new FileInputStream(Main.pid_reg_server_cert));
var server_cert_public_key_store = KeyStore.getInstance(KeyStore.getDefaultType());
server_cert_public_key_store.load(null, null);
......@@ -27,7 +27,7 @@ public class Handle {
private static KeyManager[] get_key_managers() throws Exception {
var private_key_store = KeyStore.getInstance(KeyStore.getDefaultType());
private_key_store.load(new FileInputStream("keystore.p12"), "asdfasdf".toCharArray());
private_key_store.load(new FileInputStream(Main.pid_reg_server_cert), "asdfasdf".toCharArray());
var key_manager_factory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
key_manager_factory.init(private_key_store, "asdfasdf".toCharArray());
return key_manager_factory.getKeyManagers();
......
......@@ -34,6 +34,8 @@ public class Main {
private static String archive_uri;
public static String pid_registry_uri;
public static String prefix_for_new_pids;
public static String pid_reg_server_cert;
public static String pid_reg_keystore;
// }
public static Driver driver;
......@@ -196,6 +198,8 @@ public class Main {
archive_uri = config.getProperty("archive_uri" );
pid_registry_uri = config.getProperty("pid_registry_uri" );
prefix_for_new_pids = config.getProperty("prefix_for_new_pids" );
pid_reg_server_cert = config.getProperty("pid_reg_server_cert" );
pid_reg_keystore = config.getProperty("pid_reg_keystore" );
}
......@@ -224,6 +228,8 @@ public class Main {
defaults.setProperty("archive_uri", "https://archive.sensor.community/" );
defaults.setProperty("pid_registry_uri", "https://vm13.pid.gwdg.de:8000/api/handles/");
defaults.setProperty("prefix_for_new_pids", "21.11138/" );
defaults.setProperty("pid_reg_server_cert", "pid_reg_server_cert.pem" );
defaults.setProperty("pid_reg_keystore", "pid_reg_keystore.p12" );
return defaults;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment