secretservice

package
v0.0.0-...-48d3d31 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AuthenticationDHAES authenticationMode = "dh-ietf1024-sha256-aes128-cbc-pkcs7"
View Source
const AuthenticationInsecurePlain authenticationMode = "plain"
View Source
const DefaultCollection dbus.ObjectPath = "/org/freedesktop/secrets/aliases/default"

DefaultCollection need not necessarily exist in the user's keyring.

View Source
const DefaultSessionOpenTimeout = 10 * time.Second
View Source
const NilFlags = 0
View Source
const NullPrompt = "/"
View Source
const ReplaceBehaviorDoNotReplace = 0
View Source
const ReplaceBehaviorReplace = 1
View Source
const SecretServiceInterface = "org.freedesktop.secrets"
View Source
const SecretServiceObjectPath dbus.ObjectPath = "/org/freedesktop/secrets"

Variables

This section is empty.

Functions

func NewSecretProperties

func NewSecretProperties(label string, attributes map[string]string) map[string]dbus.Variant

Types

type Attributes

type Attributes map[string]string

type PromptCompletedResult

type PromptCompletedResult struct {
	Dismissed bool
	Paths     dbus.Variant
}

type PromptDismissedError

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

func (PromptDismissedError) Error

func (p PromptDismissedError) Error() string

type Secret

type Secret struct {
	Session     dbus.ObjectPath
	Parameters  []byte
	Value       []byte
	ContentType string
}

type SecretService

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

func NewService

func NewService() (*SecretService, error)

func (*SecretService) CloseSession

func (s *SecretService) CloseSession(session *Session)

func (*SecretService) CreateItem

func (s *SecretService) CreateItem(collection dbus.ObjectPath, properties map[string]dbus.Variant, secret Secret, replaceBehavior replaceBehavior) (item dbus.ObjectPath, err error)

func (*SecretService) DeleteItem

func (s *SecretService) DeleteItem(item dbus.ObjectPath) (err error)

func (*SecretService) GetAttributes

func (s *SecretService) GetAttributes(item dbus.ObjectPath) (attributes Attributes, err error)

func (*SecretService) GetSecret

func (s *SecretService) GetSecret(item dbus.ObjectPath, session Session) (secretPlaintext []byte, err error)

func (*SecretService) LockItems

func (s *SecretService) LockItems(items []dbus.ObjectPath) (err error)

func (*SecretService) Obj

func (s *SecretService) Obj(path dbus.ObjectPath) *dbus.Object

func (*SecretService) OpenSession

func (s *SecretService) OpenSession(mode authenticationMode) (session *Session, err error)

func (*SecretService) PromptAndWait

func (s *SecretService) PromptAndWait(prompt dbus.ObjectPath) (paths *dbus.Variant, err error)

PromptAndWait is NOT thread-safe.

func (*SecretService) SearchCollection

func (s *SecretService) SearchCollection(collection dbus.ObjectPath, attributes Attributes) (items []dbus.ObjectPath, err error)

func (*SecretService) ServiceObj

func (s *SecretService) ServiceObj() *dbus.Object

func (*SecretService) SetSessionOpenTimeout

func (s *SecretService) SetSessionOpenTimeout(d time.Duration)

func (*SecretService) Unlock

func (s *SecretService) Unlock(items []dbus.ObjectPath) (err error)

type Session

type Session struct {
	Mode    authenticationMode
	Path    dbus.ObjectPath
	Public  *big.Int
	Private *big.Int
	AESKey  []byte
}

func (*Session) NewSecret

func (session *Session) NewSecret(secretBytes []byte) (Secret, error)

Jump to

Keyboard shortcuts

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