How to create ECDSA keypair (256bit) for bitcoin curve (secp256k1) using spongy castle?

后端 未结 2 841
长情又很酷
长情又很酷 2021-01-18 02:42

Currently, I am creating keyPair using this method

private  KeyPair getKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmPa         


        
2条回答
  •  再見小時候
    2021-01-18 02:54

    The documentation for KeyPairGenerator says that the initialize(int, SecureRandom) does this:

    Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).

    KeyPairGenerator is an abstract class, and I assume that this "default parameter set" is determined by a specific subclass you are using. You might try to figure out what class your KeyPairGenerator object really is, and then consult the documentation of that class to learn where you can set its default parameters.

提交回复
热议问题