您能否从代码::
下面更清楚地告诉我有关公钥和私钥的信息>keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore2.jks -storepass password -validity 9360 -keysize 2048
What is your first and last name?
[Unknown]: CLARK
What is the name of your organizational unit?
[Unknown]: OO
What is the name of your organization?
[Unknown]: O
What is the name of your City or Locality?
[Unknown]: JUMO
What is the name of your State or Province?
[Unknown]: TU
What is the two-letter country code for this unit?
[Unknown]: PA
Is CN=clark, OU=OO, O=O, L=jumo, ST=TU, C=PA correct?
[no]: yes
Enter key password for
(RETURN if same as keystore password):
从上面的例子中,什么是PrivateKey,什么是PublicKey?
请在上面的Keystore.jks文件中解释哪个部分属于PrivateKey以及哪个部分属于PublicKey?
答案 0 :(得分:0)
就像我理解的那样。 密钥库文件可以包含密钥,密钥表,可信证书。
这里的密钥只是像privateKeys一样的SecretKey KeyPairs是PrivateKeys和Certificate(包含PublicKey)的组合 TrustedCertificate是证书只能包含PublicKeys。
了解更多详情!
答案 1 :(得分:0)
请参阅keytool
的Oracle文档