credential

package
v0.0.0-...-4786ba3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainName

func DomainName(un string) string

DomainName function returns the domain name from the user name.

Types

type CCache

type CCache interface {
	Credential
	// CCache.
	CCache() *credentials.CCache
}

func NewFromCCache

func NewFromCCache(un string, ccache any, opts ...Option) CCache

func NewFromCCacheV8

func NewFromCCacheV8(un string, ccV8 *v8_credentials.CCache, opts ...Option) CCache

NewFromCCacheV8 function creates a new CCache from jcmturner/gokrb5/v8/credentials.CCache.

func NewFromCCacheV9

func NewFromCCacheV9(un string, ccache *credentials.CCache, opts ...Option) CCache

type CCacheV8

type CCacheV8 interface {
	Credential
	// CCache V8.
	CCache() *v8_credentials.CCache
}

type Credential

type Credential interface {
	// User name.
	UserName() string
	// Domain name.
	DomainName() string
	// Workstation.
	Workstation() string
}

Generic credential.

func V8ToV9

func V8ToV9(cred Credential) Credential

type EncryptionKey

type EncryptionKey interface {
	Credential
	// Encryption key value.
	KeyValue() []byte
	// Key type.
	KeyType() int
}

EncryptionKey interface represents the encryption key credentials. The KeyType represents the Kerberos 5 IANA assigned number for the key.

func NewFromEncryptionKey

func NewFromEncryptionKey(un string, keyType int, key string, opts ...Option) EncryptionKey

NewFromEncryptionKey function returns the encryption key credentials using the encryption key string.

func NewFromEncryptionKeyBytes

func NewFromEncryptionKeyBytes(un string, keyType int, key []byte, opts ...Option) EncryptionKey

NewFromEncryptionKeyBytes function returns the username/key credential.

type Keytab

type Keytab interface {
	Credential
	// Keytab.
	Keytab() *keytab.Keytab
}

Keytab interface defines the Kerberos 5 Keytab credential.

func NewFromKeytab

func NewFromKeytab(un string, ktab any, opts ...Option) Keytab

func NewFromKeytabFile

func NewFromKeytabFile(un string, keytabFile string, opts ...Option) Keytab

NewFromKeytabFile function creates a new Keytab credential from a keytab file.

func NewFromKeytabV8

func NewFromKeytabV8(un string, ktv8 *v8_keytab.Keytab, opts ...Option) Keytab

NewFromKeytabV8 function creates a new Keytab credential from a keytab from github.com/jcmtruner/gokrb5/v8 library.

func NewFromKeytabV9

func NewFromKeytabV9(un string, keytab *keytab.Keytab, opts ...Option) Keytab

NewFromKeytab function creates a new Keytab credential from a keytab.

type KeytabV8

type KeytabV8 interface {
	Credential
	// Keytab.
	Keytab() *v8_keytab.Keytab
}

type NTHash

type NTHash interface {
	// Credential. (UserName / DomainName).
	Credential
	// NT Hash.
	NTHash() []byte
}

func NewFromNTHash

func NewFromNTHash(un, hash string, opts ...Option) NTHash

NewFromNTHash function returns the NT Hash credentials using the NT hash string (hex-encoded MD4 of the password).

func NewFromNTHashBytes

func NewFromNTHashBytes(un string, hash []byte, opts ...Option) NTHash

NewFromNTHashBytes function returns the username/hash credential.

type Option

type Option interface {
	// contains filtered or unexported methods
}

func AllowEmptyPassword

func AllowEmptyPassword() Option

Allow empty password option.

func Domain

func Domain(s string) Option

func Workstation

func Workstation(s string) Option

Workstation option.

type Password

type Password interface {
	// Credential. (UserName / DomainName).
	Credential
	// Password.
	Password() string
}

Password credential.

func Anonymous

func Anonymous() Password

Anonymous function returns the anonymous password credentials.

func NewFromPassword

func NewFromPassword(un, passwd string, opts ...Option) Password

NewFromPassword function returns the username/password credential.

func NewFromString

func NewFromString(s string, opts ...Option) Password

Jump to

Keyboard shortcuts

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