crypto_test.go 506 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package libp2pquic

import (
	"crypto/rand"

	ic "github.com/libp2p/go-libp2p-crypto"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Crypto", func() {
	var (
		serverKey, clientKey ic.PrivKey
		serverID, clientID   peer.ID
	)

	Describe("keyToCertificate", func() {
		It("Ed25519", func() {
			priv, _, err := ic.GenerateEd25519Key(rand.Reader)
			Expect(err).ToNot(HaveOccurred())
			key, cert, err := keyToCertificate(priv)
			Expect(err).ToNot(HaveOccurred())
		})
	})
})