Documentation ¶
Index ¶
Constants ¶
const NACL_ED25519 = "ed25519"
NACL_ED25519 default algorithm
Variables ¶
var SupportedAlgorithms = []string{NACL_ED25519}
SupportedAlgorithms a list of supported algorithms
Functions ¶
func DecodeBase64 ¶
func EncodeBase64 ¶
Types ¶
type Key ¶
type Key struct { PublicKey ed25519.PublicKey PrivateKey ed25519.PrivateKey Version string Alg string }
Key contains keys used to sign and verify messages,
func DecodeSigningKeyBase64 ¶
DecodeSigningKeyBase64 returns a Key with PrivateKey decoded from base64 encoded key.
func DecodeVerifyKeyBase64 ¶
DecodeVerifyKeyBase64 returns a Key with PublicKey decoded from base64 encoded key.
func DecodeVerifyKeyBytes ¶
DecodeVerifyKeyBytes returns *Key with verify as public key.
func New ¶
New generates a new private/public key and returns a *Key instance that uses the given version.
type Message ¶
type Message map[string]interface{}
Message represents arbitrary decoded json object. Note that maps are passed by reference in go. Key.Sign and Key.Verify modifies the passed object so be careful make sure you have a copy before passing this object to the mentioned methods.