credential

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package credential provides Windows Credential Manager integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCredentialAPI

func EnsureCredentialAPI() bool

EnsureCredentialAPI 检查 Windows Credential API 是否可用

Types

type CREDENTIALW

type CREDENTIALW struct {
	Flags              uint32
	Type               credentialType
	TargetName         *uint16
	Comment            *uint16
	LastWritten        windows.Filetime
	CredentialBlobSize uint32
	CredentialBlob     *byte
	Persist            credPersist
	AttributeCount     uint32
	Attributes         uintptr
	TargetAlias        *uint16
	UserName           *uint16
}

CREDENTIALW 表示 Windows CREDENTIAL 结构体

type Manager

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

Manager provides credential storage and retrieval.

func New

func New(prefix, userName string) *Manager

New creates a credential manager with the given target prefix. The prefix is used to namespace credentials, e.g. "MyApp/LLM/".

func (*Manager) Delete

func (m *Manager) Delete(id string) error

Delete removes a credential.

func (*Manager) Get

func (m *Manager) Get(id string) (string, error)

Get retrieves a credential.

func (*Manager) Save

func (m *Manager) Save(id, secret string) error

Save stores a credential.

Jump to

Keyboard shortcuts

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