commons

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONCE_LEN = 24
	KEY_BYTES = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOptions

type CreateOptions struct {
	PublicKey    string `json:"public_key"`
	PrivateKey   string `json:"private_key"`
	ProtectedKey string `json:"protected_key"`
	Salt         string `json:"salt,omitempty"`
}

type CreateWithUserIDOptions

type CreateWithUserIDOptions struct {
	PublicKey    string `json:"public_key"`
	PrivateKey   string `json:"private_key"`
	ProtectedKey string `json:"protected_key"`
	Salt         string `json:"salt,omitempty"`
	UserID       string `json:"user_id,omitempty"`
}

type DecryptOptions

type DecryptOptions struct {
	Password string
	OrgID    string
}

func (*DecryptOptions) Marshal

func (o *DecryptOptions) Marshal() ([]byte, error)

type GetPublicKeyOptions

type GetPublicKeyOptions struct {
	Email  string `query:"email,omitempty"`
	UserID string `query:"user_id,omitempty"`
}

type IssueKeyPairResponse

type IssueKeyPairResponse struct {
	PublicKey           []byte `json:"public_key"`
	PrivateKey          []byte `json:"private_key"`
	DecryptedPrivateKey []byte `json:"decrypted_private_key"`
	ProtectedKey        []byte `json:"protected_key"`
	Salt                []byte `json:"salt,omitempty"`
}

type Key

type Key struct {
	ID        string    `json:"id,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	UserID    string    `json:"user_id,omitempty"`

	PublicKey    string `json:"public_key,omitempty"`
	PrivateKey   string `json:"private_key,omitempty"`
	ProtectedKey string `json:"protected_key,omitempty"`
	Salt         string `json:"salt,omitempty"`
}

func (*Key) Decode

func (k *Key) Decode() (*Payload, error)

type Payload

type Payload struct {
	PublicKey    []byte
	PrivateKey   []byte
	ProtectedKey []byte
	Salt         []byte
}

Jump to

Keyboard shortcuts

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