1 /*
2 * Copyright �, Aegeus Technology Limited.
3 * All rights reserved.
4 */
5 package jsdsi.util;
6
7
8 /***
9 * <p>Experimental class and as such may be removed without warning.</p>
10 * Utility class for Algorythm constants and names for both the JDK and SPKI.
11 *
12 * @author Sean Radford
13 * @version $Revision: 1.7 $ $Date: 2004/11/08 12:08:08 $
14 */
15 public class Algorithms {
16
17 /***
18 * The JDK type name for a SPKI Certificate
19 */
20 public static final String JDK_CERTIFICATE_TYPE_SPKI = "SPKI";
21
22 /***
23 * The JDK name for a CertificateFactory for generating SPKI Certificates from SExpressions
24 **/
25 public static final String JDK_CERTIFICATEFACTORY_SPKI_SEXP = "SPKI/SEXP";
26
27
28 /***
29 * The JDK name for a KeyFactory for generating Keys from SExpressions
30 **/
31 public static final String JDK_KEYFACTORY_SEXP = "SPKI/SEXP";
32
33 /***
34 * The JDK name for the standard SPKI CertPathBuilder
35 */
36 public static final String JDK_CERTPATHBUILDER_SPKI ="SPKI";
37
38 /***
39 * The JDK name for the standard SPKI CertPathValidatorr
40 */
41 public static final String JDK_CERTPATHVALIDATOR_SPKI ="SPKI";
42
43 /***
44 * The JDK name for the standard SPKI CertStore
45 */
46 public static final String JDK_CERTSTORE_SPKI = "SPKI";
47
48 /***
49 * The JDK name for the LDAP SPKI CertStore
50 */
51 public static final String JDK_CERTSTORE_SPKI_LDAP = "SPKI/LDAP";
52
53
54 /***
55 *
56 */
57 private Algorithms() {
58 super();
59 }
60
61 /***
62 * Generates a Signature algorythm in JDK format
63 * @param digest a DigestAlgoEnum
64 * @param key a KeyEnum
65 * @return
66 */
67 public static String jdkSignatureName(DigestAlgoEnum digest, KeyEnum key) {
68 StringBuffer sb = new StringBuffer(digest.jdkSignatureName());
69 sb.append("with");
70 sb.append(key.jdkName());
71 return sb.toString();
72 }
73
74 /***
75 * Generates a Signature algorythm in SPKI format
76 * @param digest a DigestAlgoEnum
77 * @param key a KeyEnum
78 * @return
79 */
80 public static String spkiSignatureName(DigestAlgoEnum digest, KeyEnum key) {
81 StringBuffer sb = new StringBuffer(key.spkiName());
82 sb.append('-');
83 sb.append(digest.spkiName());
84 return sb.toString();
85 }
86
87 }
This page was automatically generated by Maven