Documentation
¶
Overview ¶
modified from https://www.thepolyglotdeveloper.com/2018/02/encrypt-decrypt-data-golang-application-crypto-packages/
Generated by https://quicktype.io
Index ¶
- Constants
- func BWDelete(BITWARDENCLI_APPDATA_DIR string) error
- func BWGetAllAttachments(outputDir, sessionKey string, pws []PortWardenElement, sleepMilliseconds int) error
- func BWGetAttachment(outputDir, itemID, attachmentID, sessionKey string) error
- func BWListItemsRawBytes(sessionKey string) ([]byte, error)
- func BWLoginGetSessionKey(lc *LoginCredentials) (string, error)
- func BWLoginGetSessionKeyAndDataJSON(lc *LoginCredentials, BITWARDENCLI_APPDATA_DIR string) (string, []byte, error)
- func BWLogout() error
- func CreateBackupBytes(passphrase, sessionKey string, sleepMilliseconds int) ([]byte, error)
- func CreateBackupBytesUsingBitwardenLocalJSON(dataJson []byte, BITWARDENCLI_APPDATA_DIR, passphrase, sessionKey string, ...) ([]byte, error)
- func CreateBackupFile(fileName, passphrase, sessionKey string, sleepMilliseconds int) error
- func DecryptBackupFile(fileName, passphrase string) error
- func DecryptBytes(data []byte, passphrase string) ([]byte, error)
- func DeriveKey(passphrase string) []byte
- func EncryptBytes(data []byte, passphrase string) ([]byte, error)
- func ExtractSessionKey(stdout string) (string, error)
- type Attachment
- type Card
- type Field
- type Login
- type LoginCredentials
- type Object
- type PasswordHistory
- type PortWarden
- type PortWardenElement
- type SecureNote
- type Uris
Constants ¶
View Source
const ( BackupFolderName = "./portwarden_backup/" ErrVaultIsLocked = "vault is locked" ErrNoPhassPhraseProvided = "no passphrase provided" ErrNoFilenameProvided = "no filename provided" ErrSessionKeyExtractionFailed = "session key extraction failed" BWErrNotLoggedIn = "You are not logged in." BWErrInvalidMasterPassword = "Invalid master password." BWEnterEmailAddress = "? Email address:" BWEnterMasterPassword = "? Master password:" LoginCredentialMethodNone = 100 LoginCredentialMethodAuthenticator = 0 LoginCredentialMethodEmail = 1 LoginCredentialMethodYubikey = 3 )
View Source
const ( ErrMessageAuthenticationFailed = "cipher: message authentication failed" ErrWrongBackupPassphrase = "wrong backup passphrase entered" )
Variables ¶
This section is empty.
Functions ¶
func BWGetAllAttachments ¶
func BWGetAllAttachments(outputDir, sessionKey string, pws []PortWardenElement, sleepMilliseconds int) error
func BWGetAttachment ¶
func BWListItemsRawBytes ¶
func BWLoginGetSessionKey ¶
func BWLoginGetSessionKey(lc *LoginCredentials) (string, error)
func BWLoginGetSessionKeyAndDataJSON ¶
func BWLoginGetSessionKeyAndDataJSON(lc *LoginCredentials, BITWARDENCLI_APPDATA_DIR string) (string, []byte, error)
func CreateBackupBytes ¶
func CreateBackupFile ¶
func DecryptBackupFile ¶
func ExtractSessionKey ¶
Types ¶
type Attachment ¶
type LoginCredentials ¶
type LoginCredentials struct {
Email string `json:"email"`
Password string `json:"password"`
Method int `json:"method"`
Code string `json:"code"`
}
LoginCredentials is used to login to the `bw` cli. See documentation https://help.bitwarden.com/article/cli/ The possible `Method` values are None 100 Authenticator 0 Email 1 Yubikey 3
type PasswordHistory ¶
type PortWarden ¶
type PortWarden []PortWardenElement
type PortWardenElement ¶
type PortWardenElement struct {
Object Object `json:"object"`
ID string `json:"id"`
OrganizationID interface{} `json:"organizationId"`
FolderID *string `json:"folderId"`
Type int64 `json:"type"`
Name string `json:"name"`
Notes *string `json:"notes"`
Favorite bool `json:"favorite"`
Login *Login `json:"login,omitempty"`
RevisionDate string `json:"revisionDate"`
SecureNote *SecureNote `json:"secureNote,omitempty"`
Attachments []Attachment `json:"attachments"`
PasswordHistory []PasswordHistory `json:"passwordHistory"`
Fields []Field `json:"fields"`
Card *Card `json:"card,omitempty"`
Identity map[string]interface{} `json:"identity,omitempty"`
}
type SecureNote ¶
type SecureNote struct {
Type int64 `json:"type"`
}
Click to show internal directories.
Click to hide internal directories.




