A small package in Go to generate VAPID public and private keys required for sending web push notifications (HTTP/2 Server Push).
go get github.com/anaskhan96/go-vapidkeys
Run go test
in the package's directory to run tests.
package main
import (
"fmt"
"github.com/anaskhan96/go-vapidkeys"
"log"
)
func main() {
privateKey, publicKey, err := vapidkeys.Generate()
if err != nil {
log.Fatal(err)
}
fmt.Println("Vapid Private Key:", privateKey)
fmt.Println("Vapid Public Key:", publicKey)
}