How to use keystore in Java to store private key?

后端 未结 4 698
南笙
南笙 2020-11-28 11:04

I have used KeyPairGenerator to generate a RSA key pair. If I\'m not wrong, the KeyStore is only used to store certificates and not keys. How can I properly sto

4条回答
  •  孤独总比滥情好
    2020-11-28 11:43

    Depending on the format of your private key you might need to convert it to a format the java keytool can use.

    But if it is in a keytool supported format you should be able yo just import it using keytool. more info at:

    http://docs.oracle.com/javase/tutorial/security/toolfilex/rstep1.html

    http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/keytool.html

提交回复
热议问题