< prev index next >

src/java.base/share/classes/sun/security/provider/JavaKeyStore.java

Print this page
rev 55964 : 8162628: Migrate cacerts keystore from JKS


  51  *
  52  * @since 1.2
  53  */
  54 
  55 public abstract class JavaKeyStore extends KeyStoreSpi {
  56 
  57     // regular JKS
  58     public static final class JKS extends JavaKeyStore {
  59         String convertAlias(String alias) {
  60             return alias.toLowerCase(Locale.ENGLISH);
  61         }
  62     }
  63 
  64     // special JKS that uses case sensitive aliases
  65     public static final class CaseExactJKS extends JavaKeyStore {
  66         String convertAlias(String alias) {
  67             return alias;
  68         }
  69     }
  70 
  71     // special JKS that supports JKS and PKCS12 file formats
  72     public static final class DualFormatJKS extends KeyStoreDelegator {
  73         public DualFormatJKS() {
  74             super("JKS", JKS.class, "PKCS12", PKCS12KeyStore.class);


  75         }
  76     }
  77 
  78     private static final Debug debug = Debug.getInstance("keystore");
  79     private static final int MAGIC = 0xfeedfeed;
  80     private static final int VERSION_1 = 0x01;
  81     private static final int VERSION_2 = 0x02;
  82 
  83     // Private keys and their supporting certificate chains
  84     private static class KeyEntry {
  85         Date date; // the creation date of this entry
  86         byte[] protectedPrivKey;
  87         Certificate[] chain;
  88     };
  89 
  90     // Trusted certificates
  91     private static class TrustedCertEntry {
  92         Date date; // the creation date of this entry
  93         Certificate cert;
  94     };




  51  *
  52  * @since 1.2
  53  */
  54 
  55 public abstract class JavaKeyStore extends KeyStoreSpi {
  56 
  57     // regular JKS
  58     public static final class JKS extends JavaKeyStore {
  59         String convertAlias(String alias) {
  60             return alias.toLowerCase(Locale.ENGLISH);
  61         }
  62     }
  63 
  64     // special JKS that uses case sensitive aliases
  65     public static final class CaseExactJKS extends JavaKeyStore {
  66         String convertAlias(String alias) {
  67             return alias;
  68         }
  69     }
  70 
  71     // special JKS that supports JKS/PKCS12/PEM file formats
  72     public static final class MultipleFormatJKS extends KeyStoreDelegator {
  73         public MultipleFormatJKS() {
  74             super("JKS", JKS.class,
  75                     List.of("PKCS12", "PEM"),
  76                     List.of(PKCS12KeyStore.class, PemKeyStore.class));
  77         }
  78     }
  79 
  80     private static final Debug debug = Debug.getInstance("keystore");
  81     private static final int MAGIC = 0xfeedfeed;
  82     private static final int VERSION_1 = 0x01;
  83     private static final int VERSION_2 = 0x02;
  84 
  85     // Private keys and their supporting certificate chains
  86     private static class KeyEntry {
  87         Date date; // the creation date of this entry
  88         byte[] protectedPrivKey;
  89         Certificate[] chain;
  90     };
  91 
  92     // Trusted certificates
  93     private static class TrustedCertEntry {
  94         Date date; // the creation date of this entry
  95         Certificate cert;
  96     };


< prev index next >