简体   繁体   English

java.security.KeyStore使用什么算法来加密KeyStore.setKeyEntry()和KeyStore.store()中的privateKey?

[英]What algorithm does java.security.KeyStore use to encrypt the privateKey in KeyStore.setKeyEntry() and KeyStore.store()?

setKeyEntry() allows a password to protect a single private key, and store() allows a password to encrypt the entire keyStore. setKeyEntry()允许密码保护单个私钥,而store()允许密码加密整个密钥库。 I'm using pkcs12 keystore type with the BC as the provider, and I can't figure out what it's using for encryption. 我正在使用pkcs12密钥库类型,BC作为提供商,我无法弄清楚它用于加密的内容。

Am I able to specify the kind of encryption used in these methods? 我可以指定这些方法中使用的加密类型吗?

The KeyStore implementation depends on the type you request, and for some types, will depend on the provider as well. KeyStore实现取决于您请求的类型,对于某些类型,也取决于提供者。

If you are talking about the "JKS" type, you can find a description of the format and algorithms used here. 如果您正在谈论“JKS”类型,您可以找到此处使用的格式和算法的描述

With a JKS key store, you cannot specify an encryption algorithm for private keys. 使用JKS密钥库时,无法为私钥指定加密算法。

It depends on which KeyStore provider you are using. 这取决于您使用的KeyStore提供程序

The JCEKS provider uses PBEWithMD5AndTripleDES password-based encryption algorithm. JCEKS提供程序使用PBEWithMD5AndTripleDES基于密码的加密算法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用java.security.KeyStore类存储和加载密钥 - How to store and load keys using java.security.KeyStore class 用于java.security.KeyStore的Spring AOP代理 - Spring AOP Proxy for java.security.KeyStore JDK 1.6 与 IBM 1.5 上的 java.security.Keystore 别名 - java.security.Keystore aliases on JDK 1.6 vs IBM 1.5 使用 java.security.KeyStore 将椭圆曲线证书和私钥导入 Java Keystore - Import elliptic curve Certificate and Private Key into Java Keystore using java.security.KeyStore 我们可以从带有密钥对和证书的 java.security.KeyStore 对象中提取一个特定的别名,然后注入到一个新的 java.security.KeyStore 对象中吗? - Can we extract a specific alias from a java.security.KeyStore object with its keypair and cert, then inject into a new java.security.KeyStore object? 在java.security.KeyStore PKCS11中设置并获取DES密钥 - set and get DES key in java.security.KeyStore PKCS11 java.security.KeyStore在p12文件中仅显示两个证书之一 - java.security.KeyStore shows only one of two certs in a p12 file Java 密钥库算法 - Java Keystore Algorithm 使用BouncyCastle为java.security.Keystore生成自签名证书的简单方法 - Easy way to generate a self-signed certificate for java.security.Keystore using BouncyCastle 密钥库不适用于Java 9 - Keystore does not work on Java 9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM