Documentation ¶
Overview ¶
Package pwsafe provides read/write access to Password Safe V3 databases. See https://en.wikipedia.org/wiki/Password_Safe for more information. Unsupported fields are preserved so that databases can be manipulated without losing information.
Per the V3 specification, HMAC only covers the header and record field data, but not the field type or length.
Index ¶
- Variables
- type Header
- type PWSafeV3
- func (db *PWSafeV3) Encode(pass []byte, iter uint32) ([]byte, error)
- func (db *PWSafeV3) Header() Header
- func (db *PWSafeV3) Iterations() uint32
- func (db *PWSafeV3) ListRecords() []Record
- func (db *PWSafeV3) SetDescription(s string) error
- func (db *PWSafeV3) SetLastSaveBy(what, user, host string) error
- func (db *PWSafeV3) SetLastSaveTimestamp(t time.Time)
- func (db *PWSafeV3) SetName(s string) error
- func (db *PWSafeV3) SetUUID(uuid [16]byte)
- func (db *PWSafeV3) SetUnimplementedHeaderFields(fields []RawField) error
- type RawField
- type Record
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidDatabase = errors.New("invalid database")
)
Functions ¶
This section is empty.
Types ¶
type PWSafeV3 ¶
type PWSafeV3 struct {
// contains filtered or unexported fields
}
func Decode ¶
func Decode(b []byte, pass []byte, progressInterval time.Duration, progressFunc func(float64)) (*PWSafeV3, error)
Databases with high iterations can take a long time to decode. If progressInterval is > 0 and progressFunc != nil, progressFunc will be invoked with a value [0,100] every 'interval' duration.
func ReadFileWithPeriodicProgress ¶
func ReadFileWithPeriodicProgress(path string, pass []byte, progressInterval time.Duration, progressFunc func(f float64)) (*PWSafeV3, error)
Databases with high iterations can take a long time to decode. If progressInterval is > 0 and progressFunc != nil, progressFunc will be invoked with a value [0,100] every 'interval' duration.
func (*PWSafeV3) Iterations ¶
func (*PWSafeV3) ListRecords ¶
func (*PWSafeV3) SetDescription ¶
Returns error if s is not valid UTF8
func (*PWSafeV3) SetLastSaveBy ¶
Returns error if what, user, or host is not valid UTF8
func (*PWSafeV3) SetLastSaveTimestamp ¶
func (*PWSafeV3) SetUnimplementedHeaderFields ¶
Returns error if any field data length exceeds 32 bits
type Record ¶
type Record struct { UUID [16]byte Group string Title string Username string Email string Notes string Pass string CreationTime time.Time PassModTime time.Time LastAccessTime time.Time LastModTime time.Time URL string // Password expiry time, 'protected' status, autotype, password history, // password policy, double-click action, allowed symbols for password // generation, shift double-click action UnimplementedFields []RawField }
TODO: aliases (3.3.3), shortcuts (3.3.4)