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:
2026-07-02 14:24:24 -04:00
parent 85f9c21f4c
commit 8336ca5d87
3 changed files with 18 additions and 18 deletions
+17
View File
@@ -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)
}