8336ca5d87
Old implementation just copied random bytes as the public key (not real EC math). New cmd/keygen calls the library's proper P-256 key generation. Removed broken local GenerateVAPIDKeys from push/handlers.go.
18 lines
272 B
Go
18 lines
272 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
webpush "github.com/SherClockHolmes/webpush-go"
|
|
)
|
|
|
|
func main() {
|
|
priv, pub, err := webpush.GenerateVAPIDKeys()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
fmt.Println("VAPID_PRIVATE_KEY=" + priv)
|
|
fmt.Println("VAPID_PUBLIC_KEY=" + pub)
|
|
}
|