secretservice

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

DefaultSessionOpenTimeout

View Source
const NilFlags = 0

NilFlags

View Source
const NullPrompt = "/"

NullPrompt

View Source
const ReplaceBehaviorDoNotReplace = 0

ReplaceBehaviorDoNotReplace

View Source
const ReplaceBehaviorReplace = 1

ReplaceBehaviorReplace

View Source
const SecretServiceInterface = "org.freedesktop.secrets"

SecretServiceInterface

View Source
const SecretServiceObjectPath dbus.ObjectPath = "/org/freedesktop/secrets"

SecretServiceObjectPath

Variables

This section is empty.

Functions

func NewSecretProperties

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

NewSecretProperties

Types

type Attributes

type Attributes map[string]string

Attributes

type AuthenticationMode

type AuthenticationMode string

AuthenticationMode

const AuthenticationDHAES AuthenticationMode = "dh-ietf1024-sha256-aes128-cbc-pkcs7"

AuthenticationDHAES

const AuthenticationInsecurePlain AuthenticationMode = "plain"

AuthenticationInsecurePlain

type PromptCompletedResult

type PromptCompletedResult struct {
	Dismissed bool
	Paths     dbus.Variant
}

PromptCompletedResult

type PromptDismissedError

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

PromptDismissedError

func (PromptDismissedError) Error

func (p PromptDismissedError) Error() string

Error

type ReplaceBehavior

type ReplaceBehavior int

ReplaceBehavior

type Secret

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

Secret

type SecretService

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

SecretService

func NewService

func NewService() (*SecretService, error)

NewService

func (*SecretService) CloseSession

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

CloseSession

func (*SecretService) CreateItem

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

CreateItem

func (*SecretService) DeleteItem

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

DeleteItem

func (*SecretService) GetAttributes

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

GetAttributes

func (*SecretService) GetSecret

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

GetSecret

func (*SecretService) LockItems

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

LockItems

func (*SecretService) Obj

Obj

func (*SecretService) OpenSession

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

OpenSession

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)

SearchColleciton

func (*SecretService) ServiceObj

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

ServiceObj

func (*SecretService) SetSessionOpenTimeout

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

SetSessionOpenTimeout

func (*SecretService) Unlock

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

Unlock

type Session

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

Session

func (*Session) NewSecret

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

NewSecret

Jump to

Keyboard shortcuts

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