user

package
v4.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: BSD-2-Clause, BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptographicIdentity

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

func (*CryptographicIdentity) GetE2eDhPrivateKey

func (ci *CryptographicIdentity) GetE2eDhPrivateKey() *cyclic.Int

func (*CryptographicIdentity) GetE2eDhPublicKey

func (ci *CryptographicIdentity) GetE2eDhPublicKey() *cyclic.Int

func (*CryptographicIdentity) GetReceptionID

func (ci *CryptographicIdentity) GetReceptionID() *id.ID

func (*CryptographicIdentity) GetReceptionRSA

func (ci *CryptographicIdentity) GetReceptionRSA() rsa.PrivateKey

func (*CryptographicIdentity) GetReceptionSalt

func (ci *CryptographicIdentity) GetReceptionSalt() []byte

func (*CryptographicIdentity) GetTransmissionID

func (ci *CryptographicIdentity) GetTransmissionID() *id.ID

func (*CryptographicIdentity) GetTransmissionRSA

func (ci *CryptographicIdentity) GetTransmissionRSA() rsa.PrivateKey

func (*CryptographicIdentity) GetTransmissionSalt

func (ci *CryptographicIdentity) GetTransmissionSalt() []byte

func (*CryptographicIdentity) IsPrecanned

func (ci *CryptographicIdentity) IsPrecanned() bool

type Info

type Info struct {
	//General Identity
	TransmissionID   *id.ID
	TransmissionSalt []byte
	TransmissionRSA  rsa.PrivateKey
	ReceptionID      *id.ID
	ReceptionSalt    []byte
	ReceptionRSA     rsa.PrivateKey
	Precanned        bool
	// Timestamp in which user has registered with the network
	RegistrationTimestamp int64

	//e2e Identity
	E2eDhPrivateKey *cyclic.Int
	E2eDhPublicKey  *cyclic.Int
}

func NewUserFromBackup

func NewUserFromBackup(backup *backup.Backup) Info

func NewUserFromProto

func NewUserFromProto(proto *Proto) Info

type Proto

type Proto struct {
	//General Identity
	TransmissionID   *id.ID
	TransmissionSalt []byte
	TransmissionRSA  *oldrsa.PrivateKey
	ReceptionID      *id.ID
	ReceptionSalt    []byte
	ReceptionRSA     *oldrsa.PrivateKey
	Precanned        bool
	// Timestamp in which user has registered with the network
	RegistrationTimestamp int64

	RegCode string

	TransmissionRegValidationSig []byte
	ReceptionRegValidationSig    []byte

	//e2e Identity
	E2eDhPrivateKey *cyclic.Int
	E2eDhPublicKey  *cyclic.Int
}

type User

type User struct {
	*CryptographicIdentity
	// contains filtered or unexported fields
}

func LoadUser

func LoadUser(kv versioned.KV) (*User, error)

func NewUser

func NewUser(kv versioned.KV, transmissionID, receptionID *id.ID, transmissionSalt,
	receptionSalt []byte, transmissionRsa, receptionRsa rsa.PrivateKey, isPrecanned bool,
	e2eDhPrivateKey, e2eDhPublicKey *cyclic.Int) (*User, error)

builds a new user.

func (*User) GetReceptionRegistrationValidationSignature

func (u *User) GetReceptionRegistrationValidationSignature() []byte

Returns the reception Identity Validation Signature stored in RAM. May return nil of no signature is stored

func (*User) GetRegistrationTimestamp

func (u *User) GetRegistrationTimestamp() time.Time

Returns the registration timestamp stored in RAM as

func (*User) GetTransmissionRegistrationValidationSignature

func (u *User) GetTransmissionRegistrationValidationSignature() []byte

Returns the transmission Identity Validation Signature stored in RAM. May return nil of no signature is stored

func (*User) GetUsername

func (u *User) GetUsername() (string, error)

func (*User) PortableUserInfo

func (u *User) PortableUserInfo() Info

func (*User) SetReceptionRegistrationValidationSignature

func (u *User) SetReceptionRegistrationValidationSignature(b []byte)

Sets the Identity Validation Signature if it is not set and stores it in the ekv

func (*User) SetRegistrationTimestamp

func (u *User) SetRegistrationTimestamp(tsNano int64)

Sets the Registration Timestamp if it is not set and stores it in the ekv

func (*User) SetTransmissionRegistrationValidationSignature

func (u *User) SetTransmissionRegistrationValidationSignature(b []byte)

Sets the Identity Validation Signature if it is not set and stores it in the ekv

func (*User) SetUsername

func (u *User) SetUsername(username string) error

Jump to

Keyboard shortcuts

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