Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadPrivateKeySize = fmt.Errorf("bad ed25519 private key size") ErrBadPrivateKeyBase64Format = fmt.Errorf("bad ed25519 private key base64 format") )
View Source
var ( ErrBadPublicKeySize = fmt.Errorf("bad ed25519 public key size") ErrBadPublicKeyBase64Format = fmt.Errorf("bad ed25519 public key base64 format") )
View Source
var (
ErrBadSignatureSize = fmt.Errorf("bad ed25519 signature size")
)
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey [ed25519.PrivateKeySize]byte
PrivateKey is an ed25519 private key wrapper (64 bytes).
func (PrivateKey) GetPublicKey ¶
func (pk PrivateKey) GetPublicKey() PublicKey
GetPublicKey returns the underlying ed25519 public key.
func (PrivateKey) Sign ¶
func (pk PrivateKey) Sign(message []byte) Signature
Sign accepts a message and returns its corresponding ed25519 signature.
func (PrivateKey) String ¶
func (pk PrivateKey) String() string
String returns the base64 representation.
type PublicKey ¶
type PublicKey [ed25519.PublicKeySize]byte
PublicKey is an ed25519 public key wrapper (32 bytes).
func (PublicKey) MarshalJSON ¶
MarshalJSON encodes the base64 value of an ed25519 public key.
func (*PublicKey) UnmarshalJSON ¶
UnmarshalJSON accepts a base64 value to load an ed25519 public key.
type Signature ¶
type Signature [ed25519.SignatureSize]byte
Signature is an ed25519 signature wrapper (64 bytes).
func (Signature) MarshalJSON ¶
MarshalJSON encodes the base64 value of an ed25519 signature.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON accepts a base64 value to load an ed25519 signature.
Click to show internal directories.
Click to hide internal directories.