@Test
public void testSetTrustStoreDuplicateCertUsingFile() {

    try {
        // Read the certificate data
        java.net.URL certUrl = this.getClass().getResource("/ca.crt");
        String certData = org.apache.commons.io.IOUtils.toString(certUrl, "UTF-8");
        // Write this to a temp file
        File tempFile = tempFolder.newFile("temp.txt");
        Path tempPath = Paths.get(tempFile.getAbsolutePath());
        Files.write(tempPath, certData.getBytes());
        crypto.addCACertificateToTrustStore(tempFile, "ca"); //KeyStore overrides existing cert if same alias
    } catch (Exception e) {
        fail("testSetTrustStoreDuplicateCert should not have thrown Exception. Error: " + e.getMessage());
    }
}