am

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const NONCE_SIZE = 24
View Source
const SALT_SIZE = 16

Variables

This section is empty.

Functions

func GormOpenRetry added in v0.0.4

func GormOpenRetry(dsn string, opts ...gorm.Option) (*gorm.DB, error)

Types

type AMServer

type AMServer struct {
	ubt_am.UnimplementedUbtAccountManagerServer
	// contains filtered or unexported fields
}

func InitAMServer added in v0.0.9

func InitAMServer(dsn string, encKey []byte) *AMServer

func (*AMServer) CreateAccount

func (*AMServer) GetAccount added in v0.0.4

func (*AMServer) ListAccounts

func (*AMServer) SignPayload

type Account

type Account struct {
	Name        *string `gorm:"uniqueIndex;unique"`
	NetworkType string
	Address     string `gorm:"primaryKey"`
	PK          []byte
	PublicKey   []byte
}

type Chacha20poly1305Encryption added in v0.0.4

type Chacha20poly1305Encryption struct {
	Key []byte
}

func (*Chacha20poly1305Encryption) Decrypt added in v0.0.4

func (enc *Chacha20poly1305Encryption) Decrypt(data []byte) ([]byte, error)

func (*Chacha20poly1305Encryption) Encrypt added in v0.0.4

func (enc *Chacha20poly1305Encryption) Encrypt(data []byte) ([]byte, error)

func (*Chacha20poly1305Encryption) GetKey added in v0.0.4

func (enc *Chacha20poly1305Encryption) GetKey() []byte

type Encryption added in v0.0.4

type Encryption interface {
	GetKey() []byte
	Encrypt(data []byte) ([]byte, error)
	Decrypt(data []byte) ([]byte, error)
}

func GetEncryption added in v0.0.4

func GetEncryption(key []byte) Encryption

type NoEncryption added in v0.0.4

type NoEncryption struct {
}

func (*NoEncryption) Decrypt added in v0.0.4

func (enc *NoEncryption) Decrypt(data []byte) ([]byte, error)

func (*NoEncryption) Encrypt added in v0.0.4

func (enc *NoEncryption) Encrypt(data []byte) ([]byte, error)

func (*NoEncryption) GetKey added in v0.0.4

func (enc *NoEncryption) GetKey() []byte

Jump to

Keyboard shortcuts

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