MCPcopy
hub / github.com/gtank/cryptopasta / NewSigningKey

Function NewSigningKey

sign.go:64–67  ·  view source on GitHub ↗

NewSigningKey generates a random P-256 ECDSA private key.

()

Source from the content-addressed store, hash-verified

62
63// NewSigningKey generates a random P-256 ECDSA private key.
64func NewSigningKey() (*ecdsa.PrivateKey, error) {
65 key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
66 return key, err
67}
68
69// Sign signs arbitrary data using ECDSA.
70func Sign(data []byte, privkey *ecdsa.PrivateKey) ([]byte, error) {

Callers 1

TestSignFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSignFunction · 0.68