fix: use webpush-go's GenerateVAPIDKeys
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.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user