home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jhelp.z / Sun.java < prev    next >
Text File  |  1997-07-30  |  4KB  |  118 lines

  1. /*
  2.  * @(#)Sun.java    1.15 97/02/03
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package sun.security.provider;
  24.  
  25. import java.io.*;
  26. import java.util.*;
  27. import java.security.*;
  28.  
  29. /**
  30.  * The SUN Security Provider.
  31.  *
  32.  * @version     1.15, 02/03/97
  33.  * @author Benjamin Renaud 
  34.  */
  35.  
  36. /**
  37.  * Defines the SUN provider.
  38.  *
  39.  * Algorithm supported, and their names:
  40.  *
  41.  * - SHA-1 is the message digest scheme decribed FIPS 180-1. 
  42.  *   Aliases for SHA-1 are SHA.
  43.  *
  44.  * - DSA is the signature scheme described in FIPS 186.  (SHA used in
  45.  *   DSA is SHA-1: FIPS 186 with Change No 1.)  Aliases for DSA are
  46.  *   SHA/DSA, SHA-1/DSA, DSS and the object identifier (OID) string
  47.  *   "OID:1.3.14.3.2.13".
  48.  *
  49.  * - DSA is the key generation scheme as described in FIPS 186.
  50.  *   Aliases for DSA include the OID string "OID:1.3.14.3.2.12".
  51.  *
  52.  * - MD5 is the message digest scheme described in RFC 1321.
  53.  *   There are no aliases for MD5.
  54.  *
  55.  * Notes: The name of algorithm described in FIPS-180 is SHA-0, and is
  56.  * not supported by the SUN provider.)  
  57.  *
  58.  * @author Benjamin Renaud
  59.  * @version 1.15, 97/02/04
  60.  */
  61. public final class Sun extends Provider {
  62.  
  63.     private static String info = "SUN Security Provider v1.0, " + 
  64.     "DSA signing and key generation, SHA-1 and MD5 message digests.";
  65.  
  66.     public Sun() {
  67.     /* We are the SUN provider */
  68.     super("SUN", 1.0, info);
  69.  
  70.     /*
  71.      * Signature engines 
  72.      */
  73.     put("Signature.DSA", "sun.security.provider.DSA");
  74.  
  75.     put("Alg.Alias.Signature.SHA/DSA", "DSA");
  76.     put("Alg.Alias.Signature.SHA-1/DSA", "DSA");
  77.     put("Alg.Alias.Signature.DSS", "DSA");
  78.     put("Alg.Alias.Signature.OID:1.3.14.3.2.13", "DSA");
  79.  
  80.     /*
  81.      *  Key Pair Generator engines 
  82.      */
  83.     put("KeyPairGenerator.DSA", 
  84.         "sun.security.provider.DSAKeyPairGenerator");
  85.     put("Alg.Alias.KeyPairGenerator.OID:1.3.14.3.2.12", "DSA");
  86.  
  87.     /* 
  88.      * Digest engines 
  89.      */
  90.     put("MessageDigest.MD5", "sun.security.provider.MD5");
  91.     put("MessageDigest.SHA-1", "sun.security.provider.SHA");
  92.     
  93.     put("Alg.Alias.MessageDigest.SHA", "SHA-1");
  94.  
  95.     /*
  96.      * Algorithm name aliases 
  97.      */
  98.  
  99.     /* Algorithm properties. Used by sun.security.x509.AlgorithmId.
  100.        This is a standard way to specify non-standard properties. */
  101.     put("Alg.Class.DSA", "sun.security.x509.AlgIdDSA");
  102.     put("Alg.Class.1.3.14.3.2.12", "sun.security.x509.AlgIdDSA");
  103.     
  104.     /* Ignore everything below this line. */
  105.  
  106.     /* This is unsupported, but left there until we fix
  107.            AlgorithmId. */
  108.     put("Alg.Alias.Signature.1.3.14.3.2.13", "DSA");
  109.     put("Alg.Alias.Signature.SHAwithDSA", "DSA");
  110.     put("Alg.Alias.Signature.SHA1withDSA", "DSA");
  111.     put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA");
  112.  
  113.     /* Key types. Internal to sun.* */
  114.     put("PublicKey.X.509.DSA", "sun.security.provider.DSAPublicKey");
  115.     put("PrivateKey.PKCS#8.DSA", "sun.security.provider.DSAPrivateKey");
  116.     }
  117. }
  118.