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 enum = s.aliases(); while (enum.hasMoreElements()) { String element = (String) enum.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();}; } }