Documentation
¶
Index ¶
- func MakeDeviceIdentifier() string
- type Cipher
- type CipherLogin
- type CipherType
- type Ciphers
- type Crypter
- type Device
- type DeviceType
- type Domains
- type Folder
- type Folders
- type Kdf
- type Organization
- type Profile
- type ReaderWriter
- type Session
- func (s *Session) CacheKey(key, email, password string) error
- func (s *Session) DecryptStr(value string) (string, error)
- func (s *Session) IsValid() bool
- func (s *Session) MakeDecryptKey(salt, password string, cipher *crypto.Encrypted) *crypto.CryptoKey
- func (s *Session) MakeInternalKey(salt, password string) []byte
- func (s *Session) Read(r io.Reader) error
- func (s Session) String() string
- func (s *Session) Write(w io.Writer) error
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDeviceIdentifier ¶
func MakeDeviceIdentifier() string
MakeDeviceIdentifier creates a randomly-assigned device identifier
Types ¶
type Cipher ¶
type Cipher struct { Id string `json:"id"` Name string `json:"name"` Type CipherType `json:"type"` FolderId string `json:"folderId,omitempty"` OrganizationId string `json:"organizationId,omitempty"` Favorite bool `json:"favorite,omitempty"` Edit bool `json:"edit"` RevisionDate time.Time `json:"revisionDate"` CollectionIds []string `json:"collectionIds,omitempty"` ViewPassword bool `json:"viewPassword"` Login *CipherLogin `json:"Login,omitempty"` // Card *CardData `json:"Card,omitempty"` // SecureNote *SecureNoteData `json:"SecureNote,omitempty"` // Identity *IdentityData `json:"Identity,omitempty"` Attachments []string `json:"Attachments,omitempty"` Object string `json:"object"` }
type CipherLogin ¶
type CipherType ¶
type CipherType uint
const ( CipherTypeLogin CipherType CipherTypeNote CipherTypeCard CipherTypeIdentity )
func (CipherType) Marshal ¶
func (t CipherType) Marshal() ([]byte, error)
func (CipherType) String ¶
func (t CipherType) String() string
type Device ¶
type Device struct { Name string `json:"deviceName"` Identifier string `json:"deviceIdentifier,omitempty"` Type DeviceType `json:"deviceType,omitempty"` PushToken string `json:"devicePushToken,omitempty"` }
Device represents a device
func NewDeviceEx ¶
func NewDeviceEx(deviceType DeviceType, deviceIdentifier, name, pushToken string) *Device
Return a new device with a known identifier and type
type DeviceType ¶
type DeviceType uint
const ( Android DeviceType = iota ChromeExtension FirefoxExtension OperaExtension EdgeExtension WindowsDesktop MacOsDesktop LinuxDesktop ChromeBrowser FirefoxBrowser OperaBrowser EdgeBrowser IEBrowser UnknownBrowser AndroidAmazon UWP SafariBrowser VivaldiBrowser VivaldiExtension SafariExtension )
func MakeDeviceType ¶
func MakeDeviceType() DeviceType
MakeDeviceType returns the device type for the current runtime
type Folder ¶
type Organization ¶
type Organization struct { Id string `json:"id"` Name string `json:"name"` Status uint `json:"status"` Type uint `json:"type"` Enabled bool `json:"enabled"` Identifier string `json:"identifier"` UserId string `json:"userId"` Object string `json:"object"` }
func (Organization) String ¶
func (o Organization) String() string
type Profile ¶
type Profile struct { Id string `json:"id"` Name string `json:"name"` Email string `json:"email"` EmailVerified bool `json:"emailVerified"` Key string `json:"key"` Premium bool `json:"premium"` PremiumFromOrganization bool `json:"premiumFromOrganization"` MasterPasswordHash string `json:"masterPasswordHash"` MasterPasswordHint *string `json:"masterPasswordHint,omitempty"` Culture string `json:"culture"` TwoFactorEnabled bool `json:"twoFactorEnabled"` SecurityStamp *string `json:"securityStamp,omitempty"` ForcePasswordReset bool `json:"forcePasswordReset"` UsesKeyConnector bool `json:"usesKeyConnector"` Organizations []*Organization `json:"organizations,omitempty"` Object string `json:"object"` }
func NewProfile ¶
func NewProfile() *Profile
type ReaderWriter ¶
type Session ¶
type Session struct { // Device identifier Device *Device `json:"device,omitempty"` // Login Token Token *Token `json:"token,omitempty"` // Encryption parameters Kdf // contains filtered or unexported fields }
Session represents a long-running session with the Bitwarden server
func (*Session) CacheKey ¶
Create the encryption key from an email and password and cache it. Returns ErrNotAuthorized error if the key, email or password credentials are invalid
func (*Session) DecryptStr ¶
Decrypt a cipher string, requires a cached key first
func (*Session) MakeDecryptKey ¶
Make a decryption key from a session
func (*Session) MakeInternalKey ¶
Make a master key from a session
Click to show internal directories.
Click to hide internal directories.