credential

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainName added in v1.1.0

func DomainName(un string) string

DomainName function returns the domain name from the user name.

Types

type CCache added in v1.1.1

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

func NewFromCCache added in v1.1.1

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

func NewFromCCacheV8 added in v1.2.0

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 added in v1.2.0

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

type CCacheV8 added in v1.2.1

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 added in v1.2.1

func V8ToV9(cred Credential) Credential

type EncryptionKey added in v1.2.0

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 added in v1.2.0

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 added in v1.2.0

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 added in v1.1.0

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

func NewFromKeytabFile added in v1.1.0

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

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

func NewFromKeytabV8 added in v1.2.0

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 added in v1.2.0

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

NewFromKeytab function creates a new Keytab credential from a keytab.

type KeytabV8 added in v1.2.1

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

type NTHash added in v1.0.1

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

func NewFromNTHash added in v1.0.1

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 added in v1.0.1

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

NewFromNTHashBytes function returns the username/hash credential.

type Option added in v1.0.3

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

func AllowEmptyPassword added in v1.2.0

func AllowEmptyPassword() Option

Allow empty password option.

func Domain added in v1.2.1

func Domain(s string) Option

func Workstation added in v1.0.3

func Workstation(s string) Option

Workstation option.

type Password

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

Password credential.

func Anonymous added in v1.0.2

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