models

package
v0.0.0-...-9ca5070 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlainKeyPair

type PlainKeyPair struct {
	PrivateKey []byte `json:"privateKey"`
	PublicKey  []byte `json:"publicKey"`
}

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

User defines a user in db

func NewUser

func NewUser(username string, password string) (*User, error)

NewUser instanciates a user object

type UserKeys

type UserKeys struct {
	Username      string   `json:"username"`
	EncPrivateKey [][]byte `json:"encPrivateKey"`
	PublicKey     []byte   `json:"publicKey"`
}

UserKeys holds the RSA of a user

func NewUserKeys

func NewUserKeys(username string, encPrivateKey [][]byte, publicKey []byte) *UserKeys

NewUserKeys builds a UserKeys object. It uses a hash512 of the user's password, to encrypt the private key

Jump to

Keyboard shortcuts

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