mtg

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase64

func DecodeBase64(s string) []byte

func DecodePrivateKey

func DecodePrivateKey(s string) (ed25519.PrivateKey, error)

func DecodePublicKey

func DecodePublicKey(s string) (ed25519.PublicKey, error)

func Decrypt

func Decrypt(b []byte, privateKey ed25519.PrivateKey) ([]byte, error)

Decrypt decrypts the body with the private key and public key.

func DecryptLegacy

func DecryptLegacy(b []byte, privateKey ed25519.PrivateKey) ([]byte, error)

DecryptLegacy decrypts the body with the private key and public key. Deprecated, use Decrypt instead

func Encode

func Encode(values ...interface{}) ([]byte, error)

func Encrypt

func Encrypt(body []byte, privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey) ([]byte, error)

func EncryptLegacy

func EncryptLegacy(body []byte, privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey) ([]byte, error)

EncryptLegacy encrypts data with legacy aes key & iv Deprecated, use Encrypt instead

func Pack

func Pack(body, sig []byte) []byte

func Scan

func Scan(body []byte, dest ...interface{}) ([]byte, error)

func Sign

func Sign(body []byte, privateKey ed25519.PrivateKey) []byte

func Unpack

func Unpack(b []byte) (body, sig []byte, err error)

func Verify

func Verify(body, sig []byte, publicKey ed25519.PublicKey) bool

Types

type RawMessage

type RawMessage []byte

func (RawMessage) MarshalBinary

func (r RawMessage) MarshalBinary() ([]byte, error)

func (*RawMessage) Scan

func (r *RawMessage) Scan(src interface{}) error

func (*RawMessage) UnmarshalBinary

func (r *RawMessage) UnmarshalBinary(data []byte) error

func (RawMessage) Value

func (r RawMessage) Value() (driver.Value, error)

type Reader

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

func NewReader

func NewReader(b []byte) *Reader

func (*Reader) Read

func (r *Reader) Read(n int) ([]byte, error)

func (*Reader) ReadAll

func (r *Reader) ReadAll() ([]byte, error)

func (*Reader) ReadByte

func (r *Reader) ReadByte() (byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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