package test.at.gv.egovernment.moa.id.auth; import java.security.KeyStore; import java.util.Enumeration; import test.at.gv.egovernment.moa.id.UnitTestCase; import at.gv.egovernment.moa.id.util.SSLUtils; import at.gv.egovernment.moa.util.KeyStoreUtils; /** * @author Paul Ivancsics * @version $Id$ */ public class MOAIDAuthInitialiserTest extends UnitTestCase { public MOAIDAuthInitialiserTest(String name) { super(name); } public void testInit() throws Exception { // System.setProperty( // ConfigurationProvider.CONFIG_PROPERTY_NAME,"C://Programme/ApacheGroup/abnahme/conf/moa-id/SampleMOAIDConfiguration.xml"); // System.setProperty( // ConfigurationProvider.CONFIG_PROPERTY_NAME,"D://Daten/_Projects/moa_id_maengel/SampleMOAIDConfiguration.xml"); SSLUtils.initialize(); try { KeyStore s = KeyStoreUtils.loadKeyStore("pkcs12","file:C:/Programme/ApacheGroup/abnahme/cert/keystore.p12","changeit"); System.out.println(s.getProvider().getClass().getName()); Enumeration aliases = s.aliases(); while (aliases.hasMoreElements()) { String element = (String) aliases.nextElement(); System.out.print(element+":"); System.out.println(s.getCertificate(element).getPublicKey().getAlgorithm()); System.out.println(s.getCertificate(element).getType()); } System.out.println(s.getCertificate("pc41408").getPublicKey().getFormat()); } catch (Exception e) {e.printStackTrace();}; } }