opvault

package module
v0.0.0-...-f135f68 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: MIT Imports: 17 Imported by: 1

README

opvault

Go package for reading the 1Password OPVault format

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPassword = errors.New("invalid password")
	ErrInvalidBand     = errors.New("invalid band")
	ErrProfileLocked   = errors.New("profile locked")
)

Profile errors

View Source
var (
	ErrVaultMustBeDir = errors.New("vault must be a directory")
	ErrInvalidProfile = errors.New("invalid profile")
)

Vault Errors

View Source
var (
	ErrInvalidItemKey = errors.New("invalid item key")
)

Item errors

View Source
var (
	ErrInvalidOpdata = errors.New("invalid opdata")
)

Encryption errors

Functions

This section is empty.

Types

type Field

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

func (*Field) Designation

func (f *Field) Designation() FieldDesignation

func (*Field) Name

func (f *Field) Name() string

func (*Field) Type

func (f *Field) Type() FieldType

func (*Field) Value

func (f *Field) Value() string

type FieldDesignation

type FieldDesignation string
const (
	NoDesignation       FieldDesignation = ""
	UsernameDesignation FieldDesignation = "username"
	PasswordDesignation FieldDesignation = "password"
)

type FieldKind

type FieldKind string
const (
	ConcealedFieldKind FieldKind = "concealed"
	AddressFieldKind   FieldKind = "address"
	DateFieldKind      FieldKind = "date"
	MonthYearFieldKind FieldKind = "monthYear"
	StringFieldKind    FieldKind = "string"
	URLFieldKind       FieldKind = "URL"
	CCTypeFieldKind    FieldKind = "cctype"
	PhoneFieldKind     FieldKind = "phone"
	GenderFieldKind    FieldKind = "gender"
	EmailFieldKind     FieldKind = "email"
	MenuFieldKind      FieldKind = "menu"
)

type FieldType

type FieldType string
const (
	PasswordFieldType  FieldType = "P"
	TextFieldType      FieldType = "T"
	EmailFieldType     FieldType = "E"
	NumberFieldType    FieldType = "N"
	RadioFieldType     FieldType = "R"
	TelephoneFieldType FieldType = "TEL"
	CheckboxFieldType  FieldType = "C"
	URLFieldType       FieldType = "U"
)

type Item

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

func (*Item) Category

func (i *Item) Category() ItemCategory

func (*Item) Detail

func (i *Item) Detail() (*ItemDetail, error)

func (*Item) Tags

func (i *Item) Tags() []string

func (*Item) Title

func (i *Item) Title() string

func (*Item) Trashed

func (i *Item) Trashed() bool

type ItemCategory

type ItemCategory string
const (
	ItemCategoryLogin           ItemCategory = "001"
	ItemCategoryCreditCard      ItemCategory = "002"
	ItemCategorySecureNote      ItemCategory = "003"
	ItemCategoryIdentity        ItemCategory = "004"
	ItemCategoryPassword        ItemCategory = "005"
	ItemCategoryTombstone       ItemCategory = "099"
	ItemCategorySoftwareLicense ItemCategory = "100"
	ItemCategoryBankAccount     ItemCategory = "101"
	ItemCategoryDatabase        ItemCategory = "102"
	ItemCategoryDriverLicense   ItemCategory = "103"
	ItemCategoryOutdoorLicense  ItemCategory = "104"
	ItemCategoryMembership      ItemCategory = "105"
	ItemCategoryPassport        ItemCategory = "106"
	ItemCategoryRewards         ItemCategory = "107"
	ItemCategorySSN             ItemCategory = "108"
	ItemCategoryRouter          ItemCategory = "109"
	ItemCategoryServer          ItemCategory = "110"
	ItemCategoryEmail           ItemCategory = "111"
)

func (ItemCategory) String

func (ic ItemCategory) String() string

type ItemDetail

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

func (*ItemDetail) Fields

func (id *ItemDetail) Fields() []*Field

func (*ItemDetail) Notes

func (id *ItemDetail) Notes() string

func (*ItemDetail) Password

func (id *ItemDetail) Password() string

func (*ItemDetail) Sections

func (id *ItemDetail) Sections() []*Section

type Profile

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

func (*Profile) CreatedAt

func (p *Profile) CreatedAt() time.Time

func (*Profile) Items

func (p *Profile) Items() ([]*Item, error)

func (*Profile) Iterations

func (p *Profile) Iterations() int

func (*Profile) Lock

func (p *Profile) Lock()

func (*Profile) PasswordHint

func (p *Profile) PasswordHint() string

func (*Profile) Profile

func (p *Profile) Profile() string

func (*Profile) ProfileName

func (p *Profile) ProfileName() string

func (*Profile) Salt

func (p *Profile) Salt() []byte

func (*Profile) UUID

func (p *Profile) UUID() string

func (*Profile) Unlock

func (p *Profile) Unlock(password string) error

func (*Profile) UpdatedAt

func (p *Profile) UpdatedAt() time.Time

type Section

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

func (*Section) Fields

func (s *Section) Fields() []*SectionField

func (*Section) Name

func (s *Section) Name() string

func (*Section) Title

func (s *Section) Title() string

type SectionField

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

func (*SectionField) Kind

func (f *SectionField) Kind() FieldKind

func (*SectionField) Name

func (f *SectionField) Name() string

func (*SectionField) Title

func (f *SectionField) Title() string

func (*SectionField) Value

func (f *SectionField) Value() string

type Vault

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

func Open

func Open(dir string) (*Vault, error)

func (*Vault) Profile

func (v *Vault) Profile(profile string) (*Profile, error)

func (*Vault) ProfileNames

func (v *Vault) ProfileNames() ([]string, error)

Jump to

Keyboard shortcuts

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