Specification of JKS key store format

前端 未结 1 1532
醉梦人生
醉梦人生 2021-01-02 06:32

I was wondering if there exists an official specification of the JKS key store format used in Java? I\'d like to write a converter from/to PKCS#12, but not in Java, so keyto

相关标签:
1条回答
  • 2021-01-02 07:16

    I think you should start your research at JDK sources. There are some very useful comments there. E.g.

    /*
             * KEYSTORE FORMAT:
             *
             * Magic number (big-endian integer),
             * Version of this file format (big-endian integer),
             *
             * Count (big-endian integer),
             * followed by "count" instances of either:
             *
             *     {
             *      tag=1 (big-endian integer),
             *      alias (UTF string)
             *      timestamp
             *      encrypted private-key info according to PKCS #8
             *          (integer length followed by encoding)
             *      cert chain (integer count, then certs; for each cert,
             *          integer length followed by encoding)
             *     }
             *
             * or:
             *
             *     {
             *      tag=2 (big-endian integer)
             *      alias (UTF string)
             *      timestamp
             *      cert (integer length followed by encoding)
             *     }
             *
             * ended by a keyed SHA1 hash (bytes only) of
             *     { password + whitener + preceding body }
             */
    
    0 讨论(0)
提交回复
热议问题