File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
pkg/internal/testing/certs Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ package certs
24
24
25
25
import (
26
26
"crypto"
27
+ "crypto/ecdsa"
28
+ "crypto/elliptic"
27
29
crand "crypto/rand"
28
- "crypto/rsa"
29
30
"crypto/x509"
30
31
"crypto/x509/pkix"
31
32
"encoding/pem"
@@ -38,8 +39,8 @@ import (
38
39
)
39
40
40
41
var (
41
- rsaKeySize = 2048 // a decent number, as of 2019
42
- bigOne = big .NewInt (1 )
42
+ ellipticCurve = elliptic . P256 ()
43
+ bigOne = big .NewInt (1 )
43
44
)
44
45
45
46
// CertPair is a private key and certificate for use for client auth, as a CA, or serving.
@@ -86,7 +87,7 @@ type TinyCA struct {
86
87
// newPrivateKey generates a new private key of a relatively sane size (see
87
88
// rsaKeySize).
88
89
func newPrivateKey () (crypto.Signer , error ) {
89
- return rsa .GenerateKey (crand .Reader , rsaKeySize )
90
+ return ecdsa .GenerateKey (ellipticCurve , crand .Reader )
90
91
}
91
92
92
93
// NewTinyCA creates a new a tiny CA utility for provisioning serving certs and client certs FOR TESTING ONLY.
You can’t perform that action at this time.
0 commit comments