Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
SignatureSize = 64
)
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey() (publicKey, privateKey string)
GenerateKey generates a public/private key pair using entropy from rand. the keys is encoded by base64.RawURLEncoding
func SignPrivate ¶
SignPrivate - sign a message with public-key signature ed25519
func VerifyPublic ¶
VerifyPublic - verify message for SignPrivate
Types ¶
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
KeyPair - struct for Sign and Verify with ed25519
func KeyPairFrom ¶
KeyPairFrom converts key encoded by base64.RawURLEncoding to KeyPair. privateKey is used for sign, publicKey is used for verify. if privateKey omits, sign method can't be used.
Click to show internal directories.
Click to hide internal directories.