mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 16:58:11 +08:00
testutil: RandKeyPair
This commit is contained in:
parent
e535b0e520
commit
8ec6f3d34c
@ -12,6 +12,10 @@ import (
|
||||
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
)
|
||||
|
||||
func RandKeyPair(bits int) (ci.PrivKey, ci.PubKey, error) {
|
||||
return ci.GenerateKeyPair(ci.RSA, bits)
|
||||
}
|
||||
|
||||
func RandPeerID() (peer.ID, error) {
|
||||
_, pk, err := ci.GenerateKeyPair(ci.RSA, 512)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user