/** * Copyright (c) 2006 by Know-Center, Graz, Austria * * This software is the confidential and proprietary information of Know-Center, * Graz, Austria. You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered * into with Know-Center. * * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. * * $Id: DummyLDAPAPI.java,v 1.3 2006/10/31 08:18:56 wprinz Exp $ */ package at.knowcenter.wag.egov.egiz.sig; import java.io.File; import java.io.FileInputStream; import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; /** * This is just a dummy implementation until the real Egiz LDAP API is * implemented. * * @author wprinz */ public class DummyLDAPAPI { String url_ = null; public DummyLDAPAPI(String url) { this.url_ = url; } public String getURL() { return this.url_; } public byte[] loadCertificateFromLDAP(String serial_number, String issuer) { //logger.debug("LDAP: serial_number = " + serial_number); //logger.debug("LDAP: issuer = " + issuer); byte[] data = null; if (serial_number.equals("153868") && issuer.equals("CN=a-sign-TEST-Premium-Sig-01,OU=a-sign-TEST-Premium-Sig-01,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT")) { try { File test_file = new File(SettingsReader.CERT_PATH + File.separator + "ldap_test_cert.der"); data = new byte[(int) test_file.length()]; FileInputStream fis = new FileInputStream(test_file); fis.read(data); fis.close(); } catch (Exception e) { e.printStackTrace(); data = null; } } return data; } }