.keystore文件和.jks文件之间的区别 [英] Difference between .keystore file and .jks file

查看:168
本文介绍了.keystore文件和.jks文件之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到.keystore文件和.jks文件之间的区别,但找不到.我知道jks用于"Java密钥库",两者都是存储键/值对的一种方式.

I have tried to find the difference between .keystore files and .jks files, yet I could not find it. I know jks is for "Java keystore" and both are a way to store key/value pairs.

使用一个相对于另一个有任何区别或偏好吗?

Is there any difference or a preference to use one over another?

推荐答案

最终,.keystore.jks只是文件扩展名:明智地命名文件由您决定.某些应用程序使用存储在$HOME/.keystore中的密钥库文件:通常暗示它是JKS文件,因为

Ultimately, .keystore and .jks are just file extensions: it's up to you to name your files sensibly. Some application use a keystore file stored in $HOME/.keystore: it's usually implied that it's a JKS file, since JKS is the default keystore type in the Sun/Oracle Java security provider. Not everyone uses the .jks extension for JKS files, because it's implied as the default. I'd recommend using the extension, just to remember which type to specify (if you need).

在Java中,根据上下文的不同,密钥库"一词可以具有以下任一含义:

In Java, the word keystore can have either of the following meanings, depending on the context:

  • the API: http://docs.oracle.com/javase/6/docs/api/java/security/KeyStore.html
  • a file (or other mechanism) that can be used to back this API
  • a keystore as opposed to a truststore, as described here: https://stackoverflow.com/a/6341566/372643

在谈论文件和存储时,这实际上不是键/值对的存储工具(有很多其他格式).而是一个存储密码密钥和证书的容器(我相信其中一些还可以存储密码).通常,这些文件是经过加密和密码保护的,以免未经授权的用户使用此数据.

When talking about the file and storage, this is not really a storage facility for key/value pairs (there are plenty or other formats for this). Rather, it's a container to store cryptographic keys and certificates (I believe some of them can also store passwords). Generally, these files are encrypted and password-protected so as not to let this data available to unauthorized parties.

Java使用其 KeyStore 类和相关的API来使用密钥库(是否基于文件). JKS是Java特定的文件格式,但是该API也可以与其他文件类型(通常为PKCS#12)一起使用.要加载密钥库时,必须指定其密钥库类型.常规扩展名是:

Java uses its KeyStore class and related API to make use of a keystore (whether it's file based or not). JKS is a Java-specific file format, but the API can also be used with other file types, typically PKCS#12. When you want to load a keystore, you must specify its keystore type. The conventional extensions would be:

  • .jks用于类型"JKS"
  • .p12.pfx用于类型"PKCS12"(规范名称为PKCS#12,但Java密钥库类型名称中未使用#).
  • .jks for type "JKS",
  • .p12 or .pfx for type "PKCS12" (the specification name is PKCS#12, but the # is not used in the Java keystore type name).

此外,BouncyCastle还提供了其实现,尤其是 BKS (通常使用扩展程序),这通常用于Android应用程序.

In addition, BouncyCastle also provides its implementations, in particular BKS (typically using the .bks extension), which is frequently used for Android applications.

这篇关于.keystore文件和.jks文件之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆