crypto

package
v0.0.0-...-4496321 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRIVKEY_SIZE   = ed25519.PrivateKeySize
	PUBKEY_SIZE    = ed25519.PublicKeySize
	SIGNATURE_SIZE = ed25519.SignatureSize
)

Variables

This section is empty.

Functions

func GenerateKeypair

func GenerateKeypair() (*PrivateKey, *PublicKey)

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func NewPrivateKey

func NewPrivateKey(data ed25519.PrivateKey) (*PrivateKey, error)

func (*PrivateKey) Public

func (priv *PrivateKey) Public() *PublicKey

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(message []byte) *Signature

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(data ed25519.PublicKey) (*PublicKey, error)

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() []byte

func (*PublicKey) MarshalJSON

func (pub *PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) UnmarshalJSON

func (pub *PublicKey) UnmarshalJSON(data []byte) (err error)

func (*PublicKey) Verify

func (pub *PublicKey) Verify(message []byte, sig *Signature) bool

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func NewSignature

func NewSignature(data []byte) (*Signature, error)

func (*Signature) Bytes

func (sig *Signature) Bytes() []byte

func (*Signature) MarshalJSON

func (sig *Signature) MarshalJSON() ([]byte, error)

func (*Signature) UnmarshalJSON

func (sig *Signature) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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