key

package
v0.0.0-...-1ad4281 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivateArmored

func GetPrivateArmored(userID int64) (privateArmored pgp.PrivateKey, err error)

func GetSalt

func GetSalt(userID int64) (salt string, err error)

Types

type Private

type Private struct {
	Public
	AuthKeyHash     string
	AuthKeySalt     string
	PrivateArmored  pgp.PrivateKey
	RecoveryKeyHash string
	RecoveryArmored pgp.PrivateKey
}

func NewPrivate

func NewPrivate() *Private

func (*Private) DecodeMsg

func (z *Private) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Private) EncodeMsg

func (z *Private) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Private) Insert

func (k *Private) Insert() error

func (*Private) MarshalMsg

func (z *Private) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Private) Msgsize

func (z *Private) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Private) UnmarshalMsg

func (z *Private) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Public

type Public struct {
	ID            int64         `json:"id" msg:"id"`
	UserID        int64         `json:"userId" msg:"userId"`
	Created       int64         `json:"created" msg:"created"`
	Replaced      int64         `json:"replaced,omitempty" msg:"replaced"`
	PublicArmored pgp.PublicKey `json:"publicArmored" msg:"publicArmored"`
}

func GetPublicKeys

func GetPublicKeys(userID int64) (publicKeys []*Public, err error)

GetPublicKeys get user's encrypted publicKey

func (*Public) DecodeMsg

func (z *Public) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Public) EncodeMsg

func (z *Public) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Public) MarshalMsg

func (z *Public) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Public) Msgsize

func (z *Public) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Public) UnmarshalMsg

func (z *Public) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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