An open API service indexing awesome lists of open source software.

https://github.com/prongbang/goecdsa

Generate key pair and signing (NIST P-256 (aka secp256r1) EC key pair using ECDSA) for Golang.
https://github.com/prongbang/goecdsa

Last synced: about 1 month ago
JSON representation

Generate key pair and signing (NIST P-256 (aka secp256r1) EC key pair using ECDSA) for Golang.

Awesome Lists containing this project

README

          

# goecdsa

Generate key pair and signing (NIST P-256 (aka secp256r1) EC key pair using ECDSA) for Golang.

## Install

```shell
go get github.com/prongbang/goecdsa
```

## Generate KeyPair

```go
keyPair, err := goecdsa.GenerateKeyPair()
pk := keyPair.PublicKey
sk := keyPair.PrivateKey
pkBase64, err := keyPair.PublicKeyString()
skBase64, err := keyPair.PrivateKeyString()
```

## Sign

```go
message := "GOECDSA"
signatureBase64, err := goecdsa.SignASN1(keyPair, message)
```

## Verify

```go
message := "GOECDSA"
publicKey := "Base64"
match, err := goecdsa.Verify(publicKey, message, signatureBase64)
```