@Test
public void testGetCertificate() throws CMException {

	String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
	// Get certificate from the Keystore associated with the private key we just inserted
	Certificate privateKeyCertificate = credentialManager.getCertificate(CredentialManager.KeystoreType.KEYSTORE, alias);
	assertNotNull(privateKeyCertificate);
	assertTrue(privateKeyCertChain[0].equals(privateKeyCertificate));
	
	// We should also have some trusted certificates in the Truststore
	// Need to get their aliases
	ArrayList<String> truststoreAliases = credentialManager.getAliases(CredentialManager.KeystoreType.TRUSTSTORE);
	assertTrue(!truststoreAliases.isEmpty());
	// Just get the first one
	Certificate trustedCertificate = credentialManager.getCertificate(CredentialManager.KeystoreType.TRUSTSTORE, truststoreAliases.get(0));
	assertNotNull(trustedCertificate);
}