java keytool 导入证书_通过java keytool导入证书

我使用Java keytool,我想做一些简单的事情,但在第五步后出现问题 . 这有什么不对?

Side“A”创建公钥和私钥:

keytool -genkeypair -alias AStore -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -dname -keypass Aaa123 -validity 90 -storetype JCEKS -keystore D:\keystore\A\keystore.jceks -storepass Aaa123

Side“B”创建公钥和私钥:

keytool -genkeypair -alias BStore -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -dname -keypass Bbb123 -validity 90 -storetype JCEKS -keystore D:\keystore\B\keystore.jceks -storepass Bbb123

方“A”出口证书:

keytool -exportcert -alias AStore -file D:\keystore\A.cer -keystore D:\keystore\A\keystore.jceks -storetype JCEKS

Side“B”出口证书:

keytool -exportcert -alias BStore -file D:\keystore\B.cer -keystore D:\keystore\B\keystore.jceks -storetype JCEKS

方“B”的方“A”进口证书:

keytool -importcert -alias AStore -file D:\keystore\B.cer -keystore D:\keystore\A\keystore.jceks -storetype JCEKS

我收到错误:

> keytool error: java.lang.Exception: Public keys in reply and keystore don't match


版权声明:本文为weixin_33011357原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。