crypto

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate [32]byte

func CertificateFromString

func CertificateFromString(value string) (res Certificate)

func (Certificate) MarshalJSON

func (crt Certificate) MarshalJSON() ([]byte, error)

func (Certificate) String

func (crt Certificate) String() string

func (*Certificate) UnmarshalJSON

func (crt *Certificate) UnmarshalJSON(b []byte) error

func (Certificate) Verify

func (crt Certificate) Verify(message []byte, signature []byte) (res bool)

type PrivateKey

type PrivateKey [64]byte

func GeneratePrivateKey

func GeneratePrivateKey() (res PrivateKey)

func PrivateKeyFromBase64

func PrivateKeyFromBase64(value string) (res PrivateKey, err error)

func (PrivateKey) Base64

func (pk PrivateKey) Base64() string

func (PrivateKey) Bytes

func (pk PrivateKey) Bytes() []byte

func (PrivateKey) Certificate

func (pk PrivateKey) Certificate() (res Certificate)

func (PrivateKey) Decrypt

func (pk PrivateKey) Decrypt(peerKey [32]byte, message []byte) (result []byte, ok bool)

func (PrivateKey) Encrypt

func (pk PrivateKey) Encrypt(peerKey [32]byte, message []byte) (result []byte, err error)

func (PrivateKey) MarshalJSON

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

func (PrivateKey) Public

func (pk PrivateKey) Public() (res PublicKey)

func (PrivateKey) Sign

func (pk PrivateKey) Sign(message []byte) (signature []byte)

func (PrivateKey) String

func (pk PrivateKey) String() string

func (*PrivateKey) UnmarshalJSON

func (pk *PrivateKey) UnmarshalJSON(b []byte) error

type PublicKey

type PublicKey [32]byte

func (PublicKey) Bytes

func (pub PublicKey) Bytes() []byte

func (PublicKey) MarshalJSON

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

func (PublicKey) String

func (pub PublicKey) String() string

func (*PublicKey) UnmarshalJSON

func (pub *PublicKey) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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