o1egl / paseto

Platform-Agnostic Security Tokens implementation in GO (Golang)
MIT License
833 stars 34 forks source link

How create private/public key ? #28

Closed lotos2512 closed 3 years ago

lotos2512 commented 3 years ago

How i can create private/public key like from README.md - "Create token using asymetric key (public mode)" and use like files (id_ed25519, ided25519.pub) b, := hex.DecodeString("b4cbfb43df4ce210727d953e4a713307fa19bb7d9f85041438d9e11b942a37741eb9dbbbbc047c03fd70604e0071f0987e16b28b757225c11f00415d0e20b1a2") privateKey := ed25519.PrivateKey(b)

b, _ = hex.DecodeString("1eb9dbbbbc047c03fd70604e0071f0987e16b28b757225c11f00415d0e20b1a2") publicKey := ed25519.PublicKey(b)

lotos2512 commented 3 years ago
publicKey, privateKey, _ := ed25519.GenerateKey(nil)

private = hex.EncodeToString(privateKey)
public = hex.EncodeToString(publicKey)