1 package jsdsi;
2
3 import java.io.IOException;
4 import java.security.KeyFactory;
5 import java.security.Security;
6 import java.security.cert.CertificateFactory;
7
8 /***
9 * A cryptographic provider for SPKI/SDSI and S-expressions. Fully
10 * specified by the file jsdsi.properties.
11 *
12 * @author Sameer Ajmani
13 * @author Sean Radford
14 * @version $Revision: 1.2.2.1 $ $Date: 2005/11/08 03:12:52 $
15 */
16 public class Provider extends java.security.Provider {
17
18 private static final long serialVersionUID = 7311250711851107843L;
19
20 /***
21 * @see java.lang.Object#Object()
22 */
23 public Provider() {
24 super("JSDSI", 1, "JSDSI provider");
25 try {
26 load(Provider.class.getClassLoader().getResourceAsStream(
27 "jsdsi/jsdsi.properties"));
28 } catch (IOException e) {
29 e.printStackTrace();
30 }
31 }
32
33 /***
34 * Creates a new certificate and key factory.
35 *
36 * @param args command-line arguments (not considered).
37 * @throws Exception if an error occurs.
38 */
39 public static void main(String[] args) throws Exception {
40 Provider p = new Provider();
41 CertificateFactory cf = CertificateFactory.getInstance("SPKI/SEXP", p);
42 KeyFactory kf = KeyFactory.getInstance("SPKI/SEXP", p);
43 }
44
45 /***
46 * Installs the new cryptographic provider.
47 */
48 public static void install() {
49 Security.addProvider(new Provider());
50 }
51 }
This page was automatically generated by Maven