/[storm]/storm/org/nongnu/storm/pointers/PointerId.java
ViewVC logotype

Diff of /storm/org/nongnu/storm/pointers/PointerId.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by benja, Fri May 9 18:35:03 2003 UTC revision 1.5 by benja, Tue May 13 14:40:28 2003 UTC
# Line 39  public final class PointerId { Line 39  public final class PointerId {
39      public static String PREFIX = "urn:x-storm:pointer-0.1:";      public static String PREFIX = "urn:x-storm:pointer-0.1:";
40      public static int PREFIX_LEN = PREFIX.length();      public static int PREFIX_LEN = PREFIX.length();
41    
42      static final KeyFactory keyFactory;      static KeyFactory keyFactory;
43      static {      static {
44          try {          try {
45              keyFactory = KeyFactory.getInstance("DSA");              keyFactory = KeyFactory.getInstance("DSA");
46          } catch(NoSuchAlgorithmException e) {          } catch(NoSuchAlgorithmException e) {
47              e.printStackTrace();              e.printStackTrace();
48              throw new Error("PointerId needs DSA algorithm");              //throw new Error("PointerId needs DSA algorithm");
49          }          }
50      }      }
51      private static SecureRandom random = new SecureRandom();      private static SecureRandom random = new SecureRandom();
# Line 124  public final class PointerId { Line 124  public final class PointerId {
124    
125      public static byte[] getKeyBytes(PublicKey key)          public static byte[] getKeyBytes(PublicKey key)    
126          throws InvalidKeyException, InvalidKeySpecException {          throws InvalidKeyException, InvalidKeySpecException {
127            if(keyFactory == null) throw new Error("PointerId needs DSA algorithm");
128          key = (PublicKey)keyFactory.translateKey(key);          key = (PublicKey)keyFactory.translateKey(key);
129          EncodedKeySpec keySpec =          EncodedKeySpec keySpec =
130              (EncodedKeySpec)keyFactory.getKeySpec(key, X509EncodedKeySpec.class);              (EncodedKeySpec)keyFactory.getKeySpec(key, X509EncodedKeySpec.class);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26