Commit b3add9c4 authored by Lukas HAMEURY's avatar Lukas HAMEURY
Browse files

Merge branch '37-certificats-de-type-sante' into 'master'

Resolve "Certificats de type "Santé""

Closes #37

See merge request libriciel/pole-signature/signature/libersign!50
parents c2e82f27 f32caf41
pushd src/certificates
keystores=(rgs adullact libriciel eidas etat)
keystores=(rgs adullact libriciel eidas etat sante)
for i in "${keystores[@]}"; do
pushd "$i"
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -26,11 +26,14 @@ public class CertVerifier {
static KeyStore EIDAS_ROOTS;
static KeyStore ADULLACT_ROOTS;
static KeyStore ETAT_ROOTS;
static KeyStore SANTE_ROOTS;
static String RGS_ROOTS_NAME = "RGS";
static String LIBRICIEL_ROOTS_NAME = "LIBRICIEL";
static String ADULLACT_ROOTS_NAME = "ADULLACT";
static String ETAT_ROOTS_NAME = "ETAT";
static String EIDAS_ROOTS_NAME = "EIDAS";
static String SANTE_ROOTS_NAME = "SANTE";
static Map<String, KeyStore> rootKeystores;
......@@ -54,9 +57,10 @@ public class CertVerifier {
LIBRICIEL_ROOTS.load(keystoreIs, "certificate-libriciel".toCharArray());
rootKeystores.put(LIBRICIEL_ROOTS_NAME, LIBRICIEL_ROOTS);
// keystoreIs = CertVerifier.class.getResourceAsStream("/certificates/eidas.jks");
// EIDAS_ROOTS = KeyStore.getInstance("JKS");
// EIDAS_ROOTS.load(keystoreIs, "eidas".toCharArray());
keystoreIs = CertVerifier.class.getResourceAsStream("/certificates/eidas.jks");
EIDAS_ROOTS = KeyStore.getInstance("JKS");
EIDAS_ROOTS.load(keystoreIs, "certificate-eidas".toCharArray());
rootKeystores.put(EIDAS_ROOTS_NAME, EIDAS_ROOTS);
keystoreIs = CertVerifier.class.getResourceAsStream("/certificates/adullact.jks");
ADULLACT_ROOTS = KeyStore.getInstance("JKS");
......@@ -68,6 +72,11 @@ public class CertVerifier {
ETAT_ROOTS.load(keystoreIs, "certificate-etat".toCharArray());
rootKeystores.put(ETAT_ROOTS_NAME, ETAT_ROOTS);
keystoreIs = CertVerifier.class.getResourceAsStream("/certificates/sante.jks");
SANTE_ROOTS = KeyStore.getInstance("JKS");
SANTE_ROOTS.load(keystoreIs, "certificate-sante".toCharArray());
rootKeystores.put(SANTE_ROOTS_NAME, SANTE_ROOTS);
InputStream crlConfIs = Main.class.getResourceAsStream("/crl-list.conf");
crlListContent = toByteArray(crlConfIs);
} catch (Exception e) {
......@@ -82,9 +91,9 @@ public class CertVerifier {
loadAuthorizedCertificated();
List<String> result = new ArrayList<String>();
// if(verifyWith(cert, EIDAS_ROOTS)) {
// result.add("EIDAS");
// }
if(verifyWith(cert, EIDAS_ROOTS)) {
result.add(EIDAS_ROOTS_NAME);
}
if (verifyWith(cert, RGS_ROOTS)) {
result.add(RGS_ROOTS_NAME);
}
......@@ -97,6 +106,9 @@ public class CertVerifier {
if (verifyWith(cert, ADULLACT_ROOTS)) {
result.add(ADULLACT_ROOTS_NAME);
}
if (verifyWith(cert, SANTE_ROOTS)) {
result.add(SANTE_ROOTS_NAME);
}
return result;
}
......
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