Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
izolight committed Apr 23, 2020
1 parent 6624bf1 commit b43f9a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion csr/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (kr *KeyRequest) Size() int {
}

// Generate generates a key as specified in the request. Currently,
// only ECDSA and RSA are supported.
// only ECDSA and RSA and Ed25519 are supported.
func (kr *KeyRequest) Generate() (crypto.PrivateKey, error) {
log.Debugf("generate key from request: algo=%s, size=%d", kr.Algo(), kr.Size())
switch kr.Algo() {
Expand Down
3 changes: 3 additions & 0 deletions transport/kp/key_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func (sp *StandardProvider) Generate(algo string, size int) (err error) {
sp.internal.keyPEM = pem.EncodeToMemory(p)
sp.internal.priv = priv
case "ed25519":
if size != 256 && size != 0 {
return errors.New("ED25519 keys are always 256Bit")
}
_, priv, err := ed25519.GenerateKey(rand.Reader)

keyPEM, err := derhelpers.MarshalEd25519PrivateKey(priv)
Expand Down

0 comments on commit b43f9a2

Please sign in to comment.