Index: axis/Create.java
===================================================================
--- axis/Create.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/Create.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,61 @@
+import edu.isi.www.fedd_types.*;
+import edu.isi.www.fedd_wsdl.*;
+import java.net.URL;
+import net.deterlab.isi.XTrustProvider;
+
+class Create extends FeddCommand {
+    /**
+     * Dummy program to test an AXIS fedd implementation generated from the
+     * WSDL and run by axis.
+     * It just calls terminate with a dummy id as a local name (which can be
+     * supplied on the command line and reprints the localname that the server
+     * replies with.  A client certificate muct exist in the local keystore
+     * file with the given password. 
+     */
+    public static void main(String args[]) throws 
+	    javax.xml.rpc.ServiceException, java.net.MalformedURLException,
+	    java.rmi.RemoteException {
+	
+	/* 
+	 * Boilerplate web services access stuff.
+	 */
+	FeddPortType port = getPort("https://users.isi.deterlab.net:23235");
+	setUpSecurity();
+
+	/*
+	 * The various parts of the MultiInfo message and response
+	 */
+
+	NewResponseType resp = null;
+
+	/* This magic turns off certificate chain checking. */
+	XTrustProvider.install();
+
+	/* This tells the SSL system where to find client certificate
+	 * information. */
+	String keyStore = "./keystore";
+	String keyStorePassword = "importkey";
+
+	System.setProperty("javax.net.ssl.keyStore", keyStore);
+	System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
+	IDType id = new IDType();
+
+	NewRequestType req = new NewRequestType(null, 
+		new IDType(null, null, null, args[0], null), 
+		null);
+
+
+	try {
+	    /* Build the message and make the call */
+	    resp = port._new(req);
+	}
+	catch (FaultType f) {
+	    System.err.println("Error in New: " + f);
+	    System.exit(20);
+	}
+	ExperimentLabels newLabels = 
+	    new ExperimentLabels(resp.getExperimentID());
+	System.out.println("New success: " + newLabels.getLocalname() + "(" +
+	    newLabels.getFedid() + ")");
+    }
+}
Index: axis/FeddCommand.java
===================================================================
--- axis/FeddCommand.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/FeddCommand.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,57 @@
+import edu.isi.www.fedd_types.*;
+import edu.isi.www.fedd_wsdl.*;
+import java.net.URL;
+import net.deterlab.isi.XTrustProvider;
+import net.deterlab.isi.Fedid;
+
+class FeddCommand {
+
+    static class ExperimentLabels {
+	protected String fedid;
+	protected String localname;
+
+	public ExperimentLabels(IDType[] experimentID) {
+	    fedid = null;
+	    localname = null;
+
+	    for (IDType id: experimentID) {
+		if (id.getLocalname() != null) localname = id.getLocalname();
+		if (id.getFedid() != null) {
+		    byte[] rawFedid = id.getFedid();
+
+		    if (rawFedid != null) {
+			Fedid f = new Fedid(rawFedid);
+
+			if ( f != null) fedid =  f.toString().substring(6);
+		    }
+		}
+	    }
+	}
+	String getFedid() { return fedid; }
+	String getLocalname() { return localname; }
+    }
+
+    public static void setUpSecurity() {
+	/* This magic turns off certificate chain checking. */
+	XTrustProvider.install();
+
+	/* This tells the SSL system where to find client certificate
+	 * information. */
+	String keyStore = "./keystore";
+	String keyStorePassword = "importkey";
+
+	System.setProperty("javax.net.ssl.keyStore", keyStore);
+	System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
+    }
+
+    public static FeddPortType getPort(String server) throws 
+	    javax.xml.rpc.ServiceException, java.net.MalformedURLException {
+	/* 
+	 * Boilerplate web services access stuff.
+	 */
+	FeddServiceLocator service = new FeddServiceLocator();
+	FeddPortType port = service.getfeddPort(new URL(server));
+
+	return port;
+    }
+}
Index: axis/MultiStatus.java
===================================================================
--- axis/MultiStatus.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/MultiStatus.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,50 @@
+import edu.isi.www.fedd_types.*;
+import edu.isi.www.fedd_wsdl.*;
+import java.net.URL;
+import net.deterlab.isi.XTrustProvider;
+import net.deterlab.isi.Fedid;
+
+class MultiStatus extends FeddCommand {
+
+    /**
+     * Dummy program to test an AXIS fedd implementation generated from the
+     * WSDL and run by axis.
+     * It just calls terminate with a dummy id as a local name (which can be
+     * supplied on the command line and reprints the localname that the server
+     * replies with.  A client certificate muct exist in the local keystore
+     * file with the given password. 
+     */
+    public static void main(String args[]) throws 
+	    javax.xml.rpc.ServiceException, java.net.MalformedURLException,
+	    java.rmi.RemoteException {
+	
+	FeddPortType port = getPort("https://users.isi.deterlab.net:23235");
+	setUpSecurity();
+	/*
+	 * The various parts of the MultiInfo message and response
+	 */
+
+	MultiInfoRequestType req = new MultiInfoRequestType();
+	MultiInfoResponseType resp = null;
+
+	try {
+	    /* Build the message and make the call */
+	    resp = port.multiInfo(req);
+	}
+	catch (FaultType e) {
+	    System.out.println(e);
+	    System.exit(0);
+	}
+	if (resp.getInfo() != null) {
+	    for (InfoResponseType info: resp.getInfo()) {
+		ExperimentLabels el = 
+		    new ExperimentLabels(info.getExperimentID());
+
+		System.out.println(el.getLocalname() + ":" + el.getFedid() 
+			+":" + info.getExperimentStatus().getValue());
+	    }
+	}
+	else 
+	    System.out.println("No experiments");
+    }
+}
Index: axis/Terminate.java
===================================================================
--- axis/Terminate.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/Terminate.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,48 @@
+import edu.isi.www.fedd_types.*;
+import edu.isi.www.fedd_wsdl.*;
+import java.net.URL;
+import net.deterlab.isi.XTrustProvider;
+
+class Create extends FeddCommand {
+    /**
+     * Dummy program to test an AXIS fedd implementation generated from the
+     * WSDL and run by axis.
+     * It just calls terminate with a dummy id as a local name (which can be
+     * supplied on the command line and reprints the localname that the server
+     * replies with.  A client certificate muct exist in the local keystore
+     * file with the given password. 
+     */
+    public static void main(String args[]) throws 
+	    javax.xml.rpc.ServiceException, java.net.MalformedURLException,
+	    java.rmi.RemoteException {
+	
+	/* 
+	 * Boilerplate web services access stuff.
+	 */
+	FeddPortType port = getPort("https://users.isi.deterlab.net:23235");
+	setUpSecurity();
+
+	/*
+	 * The various parts of the Terminate message and response
+	 */
+
+	TerminateRequestType req = new TerminateRequestType(null, 
+		new IDType(null, null, null, args[0], null), 
+		null);
+	NewResponseType resp = null;
+
+
+	try {
+	    /* Build the message and make the call */
+	    resp = port._new(req);
+	}
+	catch (FaultType f) {
+	    System.err.println("Error in New: " + f);
+	    System.exit(20);
+	}
+	ExperimentLabels newLabels = 
+	    new ExperimentLabels(resp.getExperimentID());
+	System.out.println("New success: " + newLabels.getLocalname() + "(" +
+	    newLabels.getFedid() + ")");
+    }
+}
Index: axis/build.xml
===================================================================
--- axis/build.xml	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/build.xml	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,148 @@
+<!--
+  Project file for ant to build the crudge viewer.  Requires Jung and
+  bouncycastle.
+
+  Targets:
+    all: clean then compile and make docs
+    compile: build the library and test programs
+    run: run crudge
+    jar: build jar file
+    signjar: sign jar files for export
+    install: copy filed to web host
+    doc: greate API javadocs in ./doc
+    dev-doc: create developer API javadocs in ./dev-doc (includes
+	    package/private/protected functions)
+    clean: remove created files (includes .der and .pem in this directory)
+-->
+
+<project name="Fedd Axis" default="all">
+  <property name="src.dir" value="${basedir}"/>
+  <property name="lib.dir" value="${basedir}${file.separator}jar"/>
+  <property name="syslib.dir" value="/usr/local/share/java/classes"/>
+  <property name="doc.dir" value="${basedir}${file.separator}doc"/>
+  <property name="devdoc.dir" value="${basedir}${file.separator}dev-doc"/>
+  <property name="build.dir" value="${basedir}${file.separator}build"/>
+  <property name="classes.dir" value="${build.dir}/classes"/>
+  <property name="jar.dir" value="${build.dir}${file.separator}jar"/>
+  <property name="axis.task.home"
+    value="/usr/local/tomcat5.5/webapps/axis/WEB-INF/lib"/>
+  <property name="keystore.file" value="${basedir}${file.separator}keystore"/>
+  <property name="wsdl.dir" value="/zod/fedd-repo/wsdl/"/>
+
+  <path id="compile.classpath">
+    <fileset dir="${lib.dir}" includes="**/*.jar"/>
+  </path>
+
+  <taskdef resource="axis-tasks.properties" classpathref="compile.classpath" />
+
+  <target name="all" depends="clean" description="Clean then build" />
+
+  <target name="clean">
+    <delete dir="${basedir}${file.separator}edu"/>
+    <delete dir="${build.dir}"/>
+    <delete dir="${doc.dir}"/>
+    <delete dir="${devdoc.dir}"/>
+    <delete file="${keystore.file}"/>
+  </target>
+
+  <target name="compile" depends="wsdl-parse" description="Compile the source">
+    <mkdir dir="${classes.dir}" />
+    <javac srcdir="${src.dir}" destdir="${classes.dir}" 
+      classpathref="compile.classpath" includeAntRuntime="no"/>
+  </target>
+
+  <target name="keystore.check">
+    <available property="keystore.present" 
+      file="${basedir}${file.separator}keystore"/>
+  </target>
+
+
+  <target name="keys" depends="keystore.check" unless="keystore.present" >
+    <exec executable="/usr/bin/perl">
+      <arg value="./splitkey.pl"/>
+      <arg file="./emulab.pem"/>
+    </exec>
+    <exec executable="openssl">
+      <arg value="pkcs8"/>
+      <arg value="-topk8"/>
+      <arg value="-nocrypt"/>
+      <arg value="-in"/>
+      <arg file="./key.pem"/>
+      <arg value="-inform"/>
+      <arg value="PEM"/>
+      <arg value="-out"/>
+      <arg file="./key.der"/>
+      <arg value="-outform"/>
+      <arg value="DER"/>
+    </exec>
+    <exec executable="openssl">
+      <arg value="x509"/>
+      <arg value="-in"/>
+      <arg file="./cert.pem"/>
+      <arg value="-inform"/>
+      <arg value="PEM"/>
+      <arg value="-out"/>
+      <arg file="./cert.der"/>
+      <arg value="-outform"/>
+      <arg value="DER"/>
+    </exec>
+    <java classname="ImportKey" fork="true">
+      <arg file="./key.der"/>
+      <arg file="./cert.der"/>
+      <arg value="fedd"/>
+    </java>
+    <delete>
+      <fileset dir="${basedir}" includes="**/cert.*"/>
+      <fileset dir="${basedir}" includes="**/key.*"/>
+    </delete>
+    <move file="${user.home}${file.separator}keystore.ImportKey"
+      tofile="${keystore.file}"/>
+  </target>
+
+  <target name="multistatus" depends="compile,keys"
+    description="run visualizer">
+    <java classname="MultiStatus" fork="true" >
+      <classpath>
+	<path refid="compile.classpath"/>
+	<pathelement path="${classes.dir}"/>
+      </classpath>
+    </java>
+    <echo message="${user.name}"/>
+  </target>
+
+  <target name="create" depends="compile,keys"
+    description="run visualizer">
+    <java classname="Create" fork="true" >
+      <classpath>
+	<path refid="compile.classpath"/>
+	<pathelement path="${classes.dir}"/>
+      </classpath>
+      <arg value="${user.name}-test"/>
+    </java>
+  </target>
+
+  <target name="doc" description="Generate API documentation">
+    <mkdir dir="${doc.dir}"/>
+    <javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
+      classpathref="compile.classpath" access="public"
+      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
+  </target>
+
+  <target name="dev-doc" description="Generate API documentation">
+    <mkdir dir="${devdoc.dir}"/>
+    <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}"
+      classpathref="compile.classpath" access="private"
+      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
+  </target>
+
+  <target name="wsdl.check">
+    <available file="${basedir}${file.separator}edu" type="dir" 
+      property="wsdl.available"/>
+  </target>
+
+  <target name="wsdl-parse" depends="wsdl.check" unless="wsdl.available" >
+    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd.wsdl" output="${basedir}" />
+    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd_internal.wsdl"
+      output="${basedir}" />
+  </target>
+</project>
Index: axis/net/deterlab/fedd/Fedid.java
===================================================================
--- axis/net/deterlab/fedd/Fedid.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/net/deterlab/fedd/Fedid.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,97 @@
+/**
+ * Fedid
+ *
+ * Wrapper around a federated is
+ */
+
+package net.deterlab.isi;
+
+import java.security.MessageDigest;
+import java.security.PublicKey;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+
+public class Fedid {
+
+    /** The bytes in the fedid */
+    protected byte[] buf;
+
+
+    /**
+     * Empty constructor
+     */
+    public Fedid() { buf = null; }
+
+    /**
+     * Copy Constructor
+     */
+    public Fedid(Fedid f) { assign( f != null ? f.getBytes() : null); }
+    /**
+     * Create from a byte array
+     */
+    public Fedid(byte[] b) { assign(b); }
+
+    /**
+     * Create from X.509 certificate.
+     */
+    public Fedid(X509Certificate c) throws NoSuchAlgorithmException {
+	assign(c);
+    }
+
+    public void assign(byte[] b) { 
+	if ( b == null )
+	    buf = null;
+	else{
+	    buf = new byte[b.length];
+	    System.arraycopy(b, 0, buf, 0, b.length);
+	}
+    }
+
+    public void assign(X509Certificate c) throws NoSuchAlgorithmException {
+	if ( c != null ) {
+	    MessageDigest md = MessageDigest.getInstance("SHA1");
+	    PublicKey pk = c.getPublicKey();
+	    
+	    if (pk.getFormat() == "X.509" && pk.getAlgorithm() == "RSA") {
+		// This 22 is a hack, but I don't want to parse the ASN.1
+		byte[] asn1 = pk.getEncoded();
+		byte[] bits = new byte[asn1.length -22];
+
+		System.arraycopy(asn1, 22, bits, 0, bits.length);
+
+		buf = md.digest(bits);
+	    }
+	    else {
+		throw new IllegalArgumentException("Unknown Key type");
+	    }
+	}
+	else buf = null;
+    }
+
+    /**
+     * Printable version of the Fedid
+     *
+     * throws Null exception if the Fedid is uninitialized
+     */
+    public String toString() {
+	String rv ="fedid:";
+
+	for ( byte b : buf) {
+	    rv += String.format("%02x", b);
+	}
+	return rv;
+    }
+
+    public byte[] getBytes() { return buf; }
+
+    public boolean equals(Fedid f) {
+	byte[] b = f.getBytes();
+
+	if (buf.length != b.length) return false;
+	else {
+	    for ( int i =0; i < b.length; i++) 
+		if ( buf[i] != b[i]) return false;
+	    return true;
+	}
+    }
+}
Index: axis/net/deterlab/fedd/XTrustProvider.java
===================================================================
--- axis/net/deterlab/fedd/XTrustProvider.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/net/deterlab/fedd/XTrustProvider.java	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,172 @@
+/*
+ * The contents of this file are subject to the "END USER LICENSE AGREEMENT FOR F5
+ * Software Development Kit for iControl"; you may not use this file except in
+ * compliance with the License. The License is included in the iControl
+ * Software Development Kit.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is iControl Code and related documentation
+ * distributed by F5.
+ *
+ * Portions created by F5 are Copyright (C) 1996-2004 F5 Networks
+ * Inc. All Rights Reserved.  iControl (TM) is a registered trademark of
+ * F5 Networks, Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License (the "GPL"), in which case the
+ * provisions of GPL are applicable instead of those above.  If you wish
+ * to allow use of your version of this file only under the terms of the
+ * GPL and not to allow others to use your version of this file under the
+ * License, indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by the GPL.
+ * If you do not delete the provisions above, a recipient may use your
+ * version of this file under either the License or the GPL.
+ *
+ * This code has been slightly tweaked from that implementation described
+ * above.  Comments are mostly mine (tvf) and are more notes of what I
+ * understand of it.
+ */
+
+package net.deterlab.isi;
+
+import java.security.AccessController; 
+import java.security.InvalidAlgorithmParameterException; 
+import java.security.KeyStore; 
+import java.security.KeyStoreException; 
+import java.security.PrivilegedAction; 
+import java.security.Security; 
+import java.security.cert.X509Certificate; 
+  
+import javax.net.ssl.ManagerFactoryParameters; 
+import javax.net.ssl.TrustManager; 
+import javax.net.ssl.TrustManagerFactorySpi; 
+import javax.net.ssl.X509TrustManager; 
+
+import java.math.BigInteger;
+import java.util.Date;
+import java.security.Principal;
+import java.security.PublicKey;
+import java.util.Set;
+import java.util.TreeSet;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+  
+public final class XTrustProvider extends java.security.Provider { 
+    private final static String NAME = "XTrustJSSE"; 
+    private final static String INFO =
+        "XTrust JSSE Provider (implements trust factory with " + 
+	"truststore validation disabled)"; 
+    private final static double VERSION = 1.0D; 
+    private static PrintStream log = null;
+    
+    /**
+     * Constructor
+     */
+    public XTrustProvider() { 
+       super(NAME, VERSION, INFO); 
+        
+       AccessController.doPrivileged(new PrivilegedAction() { 
+         public Object run() { 
+	     put("TrustManagerFactory." + 
+		 TrustManagerFactoryImpl.getAlgorithm(),  
+		 TrustManagerFactoryImpl.class.getName()); 
+	     return null; 
+	 } 
+       }); 
+    } 
+
+    /**
+     * Install this null provider as an SSL truststore validator.
+     */
+    public static void install() {
+       if(Security.getProvider(NAME) == null) { 
+          Security.insertProviderAt(new XTrustProvider(), 2); 
+          Security.setProperty("ssl.TrustManagerFactory.algorithm",
+              TrustManagerFactoryImpl.getAlgorithm()); 
+       } 
+    } 
+    
+    /**
+     * The TrustManager implementation.
+     */
+    public final static class TrustManagerFactoryImpl 
+	    extends TrustManagerFactorySpi { 
+       public TrustManagerFactoryImpl() { } 
+       public static String getAlgorithm() { return "XTrust509"; } 
+       protected void engineInit(KeyStore keystore) throws KeyStoreException { } 
+       protected void engineInit(ManagerFactoryParameters mgrparams)
+         throws InvalidAlgorithmParameterException { 
+          throw new InvalidAlgorithmParameterException(
+              XTrustProvider.NAME + " does not use ManagerFactoryParameters"); 
+       } 
+
+       /**
+	* The getAcceptedIssuers method below needs to return an empty array of
+	* X509Certificates, but to do that we need a concrete X509Certificate
+	* Class.  This is a null implementation of that bastract class so we
+	* can return an empty array of them.  Java's funny sometimes.
+	*/
+       public static class NullX509Certificate extends X509Certificate {
+	   public NullX509Certificate() { super(); }
+
+	   public byte[] getEncoded() { return new byte[0]; }
+	   public PublicKey getPublicKey() { return null; }
+	   public String toString() { 
+	       return "Where'd you get this??? " + 
+		   "Dummy class for allocating a null array";
+	   }
+	   public void verify(PublicKey key) { }
+	   public void verify(PublicKey key, String prov) { }
+
+	   public void checkValidity() { }
+	   public void checkValidity(Date d) { }
+	   public int getBasicConstraints() { return 0; }
+	   public Principal getIssuerDN() { return null; }
+	   public boolean[] getIssuerUniqueID() { return new boolean[0]; }
+	   public boolean[] getKeyUsage() { return new boolean[0]; }
+	   public Date getNotAfter() { return null; }
+	   public Date getNotBefore() { return null; }
+	   public BigInteger getSerialNumber() { return null; }
+	   public String getSigAlgName() { return null;} 
+	   public String getSigAlgOID() { return null;} 
+	   public byte[] getSigAlgParams() { return new byte[0]; }
+	   public byte[] getSignature() { return new byte[0]; }
+	   public Principal getSubjectDN() { return null; }
+	   public boolean[] getSubjectUniqueID() { return new boolean[0]; }
+	   public byte[] getTBSCertificate() { return new byte[0]; }
+	   public int getVersion() { return 0;}
+
+	   public Set<String> getCriticalExtensionOIDs() { 
+	       return new TreeSet<String>();
+	   } 
+	   public byte[] getExtensionValue(String o) { return null; }
+	   public Set<String> getNonCriticalExtensionOIDs() { 
+	       return new TreeSet<String>();
+	   } 
+	   public boolean hasUnsupportedCriticalExtension() { return true; }
+       }
+
+       /**
+	* This is some fairly aggressive inlining to return a TrustManager that
+	* accepts all chains (it throws no exceptions out of the check
+	* functions) and returns no trusted issuers.
+	*/
+       protected TrustManager[] engineGetTrustManagers() { 
+            return new TrustManager[] { new X509TrustManager() { 
+		public X509Certificate[] getAcceptedIssuers() {
+		    return new NullX509Certificate[0];
+		} 
+		 public void checkClientTrusted(X509Certificate[] certs,
+			 String authType) { } 
+		 public void checkServerTrusted(X509Certificate[] certs,
+			 String authType) { } 
+            }}; 
+        } 
+    } 
+} 
Index: axis/splitkey.pl
===================================================================
--- axis/splitkey.pl	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
+++ axis/splitkey.pl	(revision 55de6a90f822407060a06d0a7a9fab9c845796f1)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use strict;
+use IO::File;
+
+my $cert = new IO::File(">./cert.pem") || die "Can't open cert.pem: $!\n";
+my $key = new IO::File(">./key.pem") || die "Can't open key.pem: $!\n";
+
+while (<>) {
+    (/-----BEGIN.*PRIVATE KEY/ .. /-----END.*PRIVATE KEY/) && do {
+	print $key $_;
+    };
+    (/-----BEGIN CERTIFICATE/ .. /-----END CERTIFICATE/) && do {
+	print $cert $_;
+    };
+}
+$key->close();
+$cert->close();
