key

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBoxCipher added in v0.5.0

func NewBoxCipher(pr PrivateKey, pu PublicKey) stream.Cipher

Types

type BoxCipher added in v0.5.0

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

func (*BoxCipher) Decrypt added in v0.5.0

func (c *BoxCipher) Decrypt(plaintext, ciphertext, nonce []byte) ([]byte, error)

Decrypt implements Cipher.

func (*BoxCipher) Encrypt added in v0.5.0

func (c *BoxCipher) Encrypt(ciphertext, plaintext, nonce []byte) ([]byte, error)

Encrypt implements Cipher.

func (*BoxCipher) MaxOverhead added in v0.5.0

func (c *BoxCipher) MaxOverhead() int

MaxOverhead implements Cipher.

func (*BoxCipher) NonceSize added in v0.5.0

func (c *BoxCipher) NonceSize() int

NonceSize implements Cipher.

type PrivateKey

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

func GeneratePrivateKey

func GeneratePrivateKey() (*PrivateKey, error)

func ParsePrivateKey

func ParsePrivateKey(key string) (*PrivateKey, error)

func (PrivateKey) MarshalJSON

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

func (PrivateKey) Open

func (k PrivateKey) Open(p PublicKey, ciphertext []byte, v interface{}) error

func (PrivateKey) OpenBase58

func (k PrivateKey) OpenBase58(p PublicKey, msg string, v interface{}) error

func (PrivateKey) Public

func (k PrivateKey) Public() PublicKey

func (PrivateKey) Seal

func (k PrivateKey) Seal(p PublicKey, v interface{}) ([]byte, error)

func (PrivateKey) SealBase58

func (k PrivateKey) SealBase58(p PublicKey, v interface{}) (string, error)

func (PrivateKey) String

func (k PrivateKey) String() string

func (*PrivateKey) UnmarshalJSON

func (k *PrivateKey) UnmarshalJSON(bs []byte) error

type PublicKey

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

func ParsePublicKey

func ParsePublicKey(key string) (*PublicKey, error)

func (PublicKey) MarshalJSON

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

func (PublicKey) String

func (k PublicKey) String() string

func (*PublicKey) UnmarshalJSON

func (k *PublicKey) UnmarshalJSON(bs []byte) error

Jump to

Keyboard shortcuts

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