@Test
public void testLoadX509CertificateInvalid() throws IOException {

    Path path = Paths.get("src/test/resources/invalid_x509.cert");
    String certStr = new String(Files.readAllBytes(path));
    try {
        Crypto.loadX509Certificate(certStr);
        fail();
    } catch (CryptoException ex) {
        assertTrue(true, "Caught expected CryptoException");
    }
    File failX509Cert = new File("./src/test/resources/fail_x509.cert");
    try {
        Crypto.loadX509Certificate(failX509Cert);
        fail();
    } catch (CryptoException e) {
        assertTrue(true, "Caught FileNotFoundException while");
    }
}