Created
September 21, 2023 20:44
-
-
Save thiagozs/3d375712e0a1cea70edd301999506f13 to your computer and use it in GitHub Desktop.
Paseto secret external Hex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"aidanwoods.dev/go-paseto" | |
) | |
func main() { | |
secretKey := paseto.NewV4AsymmetricSecretKey() // don't share this!!! | |
publicKey := secretKey.Public() // DO share this one | |
fmt.Println("Gen SecretKey:", secretKey.ExportHex()) | |
fmt.Println("Gen PublicKey:", publicKey.ExportHex()) | |
secret, err := paseto.NewV4AsymmetricSecretKeyFromHex(secretKey.ExportHex()) | |
if err != nil { | |
fmt.Println("Error NewV4AsymmetricSecretKeyFromHex:", err) | |
return | |
} | |
fmt.Println("Secret:", secret.ExportHex()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment