ED25519

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKey

type PrivateKey [ed25519.PrivateKeySize]byte

PrivateKey is an ED25519 private key wrapper (64 bytes).

func NewPrivateKey

func NewPrivateKey(privateKeyBytes []byte) *PrivateKey

PrivateKey constructor.

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.

type PublicKey

type PublicKey [ed25519.PublicKeySize]byte

PublicKey is an ED25519 public key wrapper (32 bytes).

func (PublicKey) MarshalJSON

func (pk PublicKey) MarshalJSON() ([]byte, error)

MarshalJSON returns the base64 value of an ED25519 public key.

func (*PublicKey) UnmarshalJSON

func (pk *PublicKey) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a base64 value to load a ED25519 public key.

func (PublicKey) Verify

func (pk PublicKey) Verify(message []byte, signature *Signature) bool

Verify indicates if a message and a signature match.

type Signature

type Signature [ed25519.SignatureSize]byte

Signature is an ED25519 signature wrapper (64 bytes).

func (Signature) MarshalJSON

func (s Signature) MarshalJSON() ([]byte, error)

MarshalJSON returns the base64 value of an ED25519 signature.

func (*Signature) UnmarshalJSON

func (s *Signature) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a base64 value to load an ED25519 signature.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL