Java Retrieve the actual value of the public key from the KeyPair object

前端 未结 3 942
梦谈多话
梦谈多话 2020-12-18 15:00

I wanted to ask how to retrieve the actual values of the private and public keys from the KeyPair object because i need to export them and save in a database.



        
3条回答
  •  青春惊慌失措
    2020-12-18 15:34

    Have you looked into the docs?

    Try the following :

    getModulus

    getPublicExponent

    getPrivateExponent

    They all return BigInteger

    than can in turn be stored.

    Also see if the raw encoded format is of help.

提交回复
热议问题