package eu.osci;

import java.security.KeyStore;
import java.util.logging.Level;
import java.util.logging.Logger;

import eu.osci.helper.CryptoTools;


/**
 * Copyright © 2010 Freie Hansestadt Bremen. <br>
 * Created by bremen online services Entwicklungs- und Betriebsgesellschaft mbH & Co. KG. <br>
 * This library (Starter Kit) can be used by anybody according to the Bremer Lizenz für freie
 * Softwarebibliotheken. The license terms can be viewed at www.osci.de or can be ordered at the
 * OSCI-Leitstelle (Die Senatorin für Finanzen, Freie Hansestadt Bremen, Postfach 10 15 40, 28015 Bremen).
 * 
 * @author R. Lindemann
 */
public class TestHelper
{

  private static Logger LOG = Logger.getLogger(TestHelper.class.getName());

  public static KeyStore sigatureStore = null;

  public static KeyStore encryptionStore = null;

  public static void main(String[] args) throws Exception
  {
    System.out.println("stream: " + TestHelper.class.getResourceAsStream("/manager_signature.p12"));
    KeyStore p12 = CryptoTools.loadPKCS12(TestHelper.class.getResourceAsStream("/manager_signature.p12"),
                                          "123456".toCharArray());
    LOG.log(Level.SEVERE, "Alias: " + p12.aliases().nextElement());

  }

  static
  {
    try
    {
      sigatureStore = CryptoTools.loadPKCS12(TestHelper.class.getResourceAsStream("/manager_signature.p12"),
                                             "123456".toCharArray());
      encryptionStore = CryptoTools.loadPKCS12(TestHelper.class.getResourceAsStream("/test_alice_cypher.p12"),
                                               "123456".toCharArray());

    }
    catch (Exception ex)
    {
      LOG.log(Level.SEVERE, "Error:", ex);
    }

  }

}
