Documentation
¶
Index ¶
- Constants
- Variables
- func AdjustHttpTransportWithCaCerts(transport *http.Transport)
- func AdjustTlsConfigWithCaCerts(tlsConfig *tls.Config)
- func CaCerts() *x509.CertPool
- func CreateProtectedTempDirectory(parent, pattern string) (string, error)
- func CreateProtectedTempFile(parent, pattern string, mode os.FileMode) (*os.File, error)
- func CutEngityObjectIdPrefix(in asn1.ObjectIdentifier) (rest asn1.ObjectIdentifier)
- func DoWithEachAuthorizedKey[R any](requireExistence bool, ...) (result R, err error)
- func ExportKnownHostKey(identityFile, address string) ([]byte, error)
- func ExportKnownHostKeys(keys []PrivateKey, address string) ([]byte, error)
- func ExportPublicKey(identityFile, comment string) ([]byte, error)
- func FetchKnownHostKey(ctx context.Context, address string) ([]byte, error)
- func ImportCertificateAuthoritiesFile(path string, imported []byte, expectedFingerprint string) (int, error)
- func ImportKnownHostsFile(path string, imported []byte, expectedFingerprint string) (int, error)
- func MarshalPublicKey(key PublicKey) []byte
- func NewKnownHostsCallback(inline KnownHosts, file KnownHostsFile) (ssh.HostKeyCallback, error)
- func PrefixWithEngityObjectId(in asn1.ObjectIdentifier) asn1.ObjectIdentifier
- func WriteBootstrapFile(path string, data []byte, force bool) (rErr error)
- func WriteSshPrivateKey(pk PrivateKey, to io.Writer) error
- type AgeSshIdentities
- type AgeSshRecipient
- type AuthorizedKeyOption
- func (this AuthorizedKeyOption) IsEqualTo(other any) bool
- func (this AuthorizedKeyOption) MarshalText() ([]byte, error)
- func (this *AuthorizedKeyOption) Set(text string) error
- func (this AuthorizedKeyOption) String() string
- func (this *AuthorizedKeyOption) UnmarshalText(text []byte) error
- func (this AuthorizedKeyOption) Validate() error
- type AuthorizedKeyOptionType
- func (this AuthorizedKeyOptionType) IsEqualTo(other any) bool
- func (this AuthorizedKeyOptionType) IsZero() bool
- func (this AuthorizedKeyOptionType) MarshalText() ([]byte, error)
- func (this *AuthorizedKeyOptionType) Set(text string) error
- func (this AuthorizedKeyOptionType) String() string
- func (this *AuthorizedKeyOptionType) UnmarshalText(text []byte) error
- func (this AuthorizedKeyOptionType) Validate() error
- type AuthorizedKeyWithOptions
- type AuthorizedKeys
- type AuthorizedKeysFile
- type DsaRestriction
- func (this DsaRestriction) BitsAllowed(in int) bool
- func (this DsaRestriction) IsEqualTo(other any) bool
- func (this DsaRestriction) IsZero() bool
- func (this DsaRestriction) KeyAllowed(in any) (bool, error)
- func (this DsaRestriction) MarshalText() (text []byte, err error)
- func (this *DsaRestriction) Set(text string) error
- func (this DsaRestriction) String() string
- func (this *DsaRestriction) UnmarshalText(text []byte) error
- func (this DsaRestriction) Validate() error
- type EcdsaRestriction
- func (this EcdsaRestriction) BitsAllowed(in int) bool
- func (this EcdsaRestriction) IsEqualTo(other any) bool
- func (this EcdsaRestriction) IsZero() bool
- func (this EcdsaRestriction) KeyAllowed(in any) (bool, error)
- func (this EcdsaRestriction) MarshalText() (text []byte, err error)
- func (this *EcdsaRestriction) Set(text string) error
- func (this EcdsaRestriction) String() string
- func (this *EcdsaRestriction) UnmarshalText(text []byte) error
- func (this EcdsaRestriction) Validate() error
- type Ed25519Restriction
- func (this Ed25519Restriction) BitsAllowed(in int) bool
- func (this Ed25519Restriction) IsEqualTo(other any) bool
- func (this Ed25519Restriction) IsZero() bool
- func (this Ed25519Restriction) KeyAllowed(in any) (bool, error)
- func (this Ed25519Restriction) MarshalText() (text []byte, err error)
- func (this *Ed25519Restriction) Set(text string) error
- func (this Ed25519Restriction) String() string
- func (this *Ed25519Restriction) UnmarshalText(text []byte) error
- func (this Ed25519Restriction) Validate() error
- type EllipticCurveType
- type Htpasswd
- func (this Htpasswd) IsEqualTo(other any) bool
- func (this Htpasswd) IsZero() bool
- func (this Htpasswd) MarshalText() (text []byte, err error)
- func (this Htpasswd) Match(username, password string) bool
- func (this *Htpasswd) Set(text string) error
- func (this Htpasswd) String() string
- func (this *Htpasswd) UnmarshalText(text []byte) error
- func (this Htpasswd) Validate() error
- type HtpasswdFile
- func (this HtpasswdFile) IsEqualTo(other any) bool
- func (this HtpasswdFile) IsZero() bool
- func (this HtpasswdFile) MarshalText() (text []byte, err error)
- func (this HtpasswdFile) Match(username, password string) bool
- func (this *HtpasswdFile) Set(text string) error
- func (this HtpasswdFile) String() string
- func (this *HtpasswdFile) UnmarshalText(text []byte) error
- func (this HtpasswdFile) Validate() error
- type KeyRequirement
- type KeyType
- type KnownHosts
- type KnownHostsFile
- type ObjectId
- func (this *ObjectId) FromNative(in asn1.ObjectIdentifier) error
- func (this ObjectId) IsEqualTo(other any) bool
- func (this ObjectId) IsZero() bool
- func (this ObjectId) MarshalText() (text []byte, err error)
- func (this *ObjectId) Set(plain string) error
- func (this ObjectId) String() string
- func (this ObjectId) ToNative() (asn1.ObjectIdentifier, error)
- func (this ObjectId) ToNativeDirect() asn1.ObjectIdentifier
- func (this *ObjectId) UnmarshalText(text []byte) error
- func (this ObjectId) Validate() error
- type Password
- func (this Password) Compare(withPassword []byte) (bool, error)
- func (this Password) IsEqualTo(other any) bool
- func (this Password) IsZero() bool
- func (this Password) MarshalText() ([]byte, error)
- func (this *Password) Set(plain string) error
- func (this *Password) SetPassword(t PasswordType, password []byte) error
- func (this Password) String() string
- func (this *Password) UnmarshalText(b []byte) error
- func (this Password) Validate() error
- type PasswordFile
- func (this PasswordFile) GetPassword() (Password, error)
- func (this PasswordFile) IsEqualTo(other any) bool
- func (this PasswordFile) IsZero() bool
- func (this PasswordFile) MarshalText() ([]byte, error)
- func (this *PasswordFile) Set(plain string) error
- func (this PasswordFile) SetPassword(v Password) error
- func (this PasswordFile) String() string
- func (this *PasswordFile) UnmarshalText(b []byte) error
- func (this PasswordFile) Validate() error
- type PasswordType
- func (this PasswordType) Compare(encoded, password []byte) (bool, error)
- func (this PasswordType) Encode(password []byte) ([]byte, error)
- func (this PasswordType) Generate(rand io.Reader) (decoded []byte, encoded Password, _ error)
- func (this PasswordType) IsEqualTo(other any) bool
- func (this PasswordType) MarshalText() ([]byte, error)
- func (this *PasswordType) Set(plain string) error
- func (this PasswordType) String() string
- func (this *PasswordType) UnmarshalText(b []byte) error
- func (this PasswordType) Validate() error
- type PrivateKey
- type PublicKey
- type PublicKeys
- type PublicKeysFile
- type Restriction
- type RsaRestriction
- func (this RsaRestriction) BitsAllowed(in int) bool
- func (this RsaRestriction) IsEqualTo(other any) bool
- func (this RsaRestriction) IsZero() bool
- func (this RsaRestriction) KeyAllowed(in any) (bool, error)
- func (this RsaRestriction) MarshalText() (text []byte, err error)
- func (this *RsaRestriction) Set(text string) error
- func (this RsaRestriction) String() string
- func (this *RsaRestriction) UnmarshalText(text []byte) error
- func (this RsaRestriction) Validate() error
Constants ¶
View Source
const ( DefaultKeyBitSize = 4096 DefaultDsaParameterSize = dsa.L2048N256 DefaultEllipticCurveType = EllipticCurveTypeP521 )
View Source
const ( ObjectIdEmpty = ObjectId(0) ObjectIdSessionId = ObjectId(1) )
View Source
const MaxBootstrapInputSize = 4 * 1024 * 1024
Variables ¶
View Source
var ( ErrIllegalSshKey = errors.New("illegal ssh key found") ErrIllegalAuthorizedKeysFormat = errors.New("illegal authorized keys format") )
View Source
var (
DefaultDsaRestriction = DsaRestrictionNone
)
View Source
var (
DefaultEcdsaRestriction = EcdsaRestrictionAtLeast384Bits
)
View Source
var (
DefaultEd25519Restriction = Ed25519RestrictionAll
)
View Source
var (
DefaultRsaRestriction = RsaRestrictionAtLeast4096Bits
)
View Source
var (
ErrIllegalAuthorizedKeyOption = errors.New("illegal authorized key option")
)
View Source
var (
ErrIllegalAuthorizedKeyOptionType = errors.New("illegal authorized key option type")
)
View Source
var (
ErrIllegalObjectId = errors.Config.Newf("illegal object-id")
)
View Source
var (
ErrIllegalPassword = errors.New("illegal password")
)
View Source
var (
ErrIllegalPasswordFile = errors.Config.Newf("illegal password file")
)
View Source
var (
ErrIllegalPasswordType = errors.New("illegal password type")
)
View Source
var ErrIllegalPublicKeysFormat = errors.New("illegal public keys format")
Functions ¶
func AdjustHttpTransportWithCaCerts ¶ added in v0.3.0
func AdjustTlsConfigWithCaCerts ¶ added in v0.3.0
func CreateProtectedTempDirectory ¶
CreateProtectedTempDirectory creates a private mode-0700 temporary directory.
func CreateProtectedTempFile ¶
CreateProtectedTempFile creates a private temporary file. Modes granting group or other permissions are rejected instead of being silently clamped.
func CutEngityObjectIdPrefix ¶ added in v0.4.0
func CutEngityObjectIdPrefix(in asn1.ObjectIdentifier) (rest asn1.ObjectIdentifier)
func DoWithEachAuthorizedKey ¶
func ExportKnownHostKey ¶
func ExportKnownHostKeys ¶
func ExportKnownHostKeys(keys []PrivateKey, address string) ([]byte, error)
func ExportPublicKey ¶
func FetchKnownHostKey ¶
func ImportKnownHostsFile ¶
func MarshalPublicKey ¶
func NewKnownHostsCallback ¶
func NewKnownHostsCallback(inline KnownHosts, file KnownHostsFile) (ssh.HostKeyCallback, error)
func PrefixWithEngityObjectId ¶ added in v0.4.0
func PrefixWithEngityObjectId(in asn1.ObjectIdentifier) asn1.ObjectIdentifier
func WriteBootstrapFile ¶
func WriteSshPrivateKey ¶
func WriteSshPrivateKey(pk PrivateKey, to io.Writer) error
Types ¶
type AgeSshIdentities ¶
type AgeSshIdentities struct {
// contains filtered or unexported fields
}
func NewAgeSshIdentities ¶
func NewAgeSshIdentities(keys []PrivateKey) (*AgeSshIdentities, error)
func (*AgeSshIdentities) DecryptForFingerprint ¶
func (this *AgeSshIdentities) DecryptForFingerprint(input io.Reader, fingerprint string) (io.Reader, error)
DecryptForFingerprint restricts decryption to the identity with the given SSH fingerprint instead of trying every configured identity.
type AgeSshRecipient ¶
type AgeSshRecipient struct {
// contains filtered or unexported fields
}
func NewAgeSshRecipient ¶
func NewAgeSshRecipient(key ssh.PublicKey) (*AgeSshRecipient, error)
func (*AgeSshRecipient) Encrypt ¶
func (this *AgeSshRecipient) Encrypt(output io.Writer) (io.WriteCloser, error)
func (*AgeSshRecipient) Fingerprint ¶
func (this *AgeSshRecipient) Fingerprint() string
type AuthorizedKeyOption ¶ added in v0.2.0
type AuthorizedKeyOption struct {
Type AuthorizedKeyOptionType
Value string
}
func (AuthorizedKeyOption) IsEqualTo ¶ added in v0.2.0
func (this AuthorizedKeyOption) IsEqualTo(other any) bool
func (AuthorizedKeyOption) MarshalText ¶ added in v0.2.0
func (this AuthorizedKeyOption) MarshalText() ([]byte, error)
func (*AuthorizedKeyOption) Set ¶ added in v0.2.0
func (this *AuthorizedKeyOption) Set(text string) error
func (AuthorizedKeyOption) String ¶ added in v0.2.0
func (this AuthorizedKeyOption) String() string
func (*AuthorizedKeyOption) UnmarshalText ¶ added in v0.2.0
func (this *AuthorizedKeyOption) UnmarshalText(text []byte) error
func (AuthorizedKeyOption) Validate ¶ added in v0.2.0
func (this AuthorizedKeyOption) Validate() error
type AuthorizedKeyOptionType ¶ added in v0.2.0
type AuthorizedKeyOptionType uint8
const ( AuthorizedKeyOptionEmpty AuthorizedKeyOptionType = iota AuthorizedKeyAgentForwarding AuthorizedKeyNoAgentForwarding AuthorizedKeyCertAuthority AuthorizedKeyCommand AuthorizedKeyEnvironment AuthorizedKeyExpiryTime AuthorizedKeyFrom AuthorizedKeyPermitListen AuthorizedKeyPermitOpen AuthorizedKeyPrincipals AuthorizedKeyPortForwarding AuthorizedKeyNoPortForwarding AuthorizedKeyPty AuthorizedKeyNoPty AuthorizedKeyNoTouchRequired AuthorizedKeyVerifyRequired AuthorizedKeyRestrict AuthorizedKeyTunnel AuthorizedKeyUserRc AuthorizedKeyNoUserRc AuthorizedKeyX11Forwarding AuthorizedKeyNoX11Forwarding )
func (AuthorizedKeyOptionType) IsEqualTo ¶ added in v0.2.0
func (this AuthorizedKeyOptionType) IsEqualTo(other any) bool
func (AuthorizedKeyOptionType) IsZero ¶ added in v0.2.0
func (this AuthorizedKeyOptionType) IsZero() bool
func (AuthorizedKeyOptionType) MarshalText ¶ added in v0.2.0
func (this AuthorizedKeyOptionType) MarshalText() ([]byte, error)
func (*AuthorizedKeyOptionType) Set ¶ added in v0.2.0
func (this *AuthorizedKeyOptionType) Set(text string) error
func (AuthorizedKeyOptionType) String ¶ added in v0.2.0
func (this AuthorizedKeyOptionType) String() string
func (*AuthorizedKeyOptionType) UnmarshalText ¶ added in v0.2.0
func (this *AuthorizedKeyOptionType) UnmarshalText(text []byte) error
func (AuthorizedKeyOptionType) Validate ¶ added in v0.2.0
func (this AuthorizedKeyOptionType) Validate() error
type AuthorizedKeyWithOptions ¶ added in v0.2.0
type AuthorizedKeyWithOptions struct {
ssh.PublicKey
Options []AuthorizedKeyOption
}
type AuthorizedKeys ¶ added in v0.2.0
type AuthorizedKeys string
func (AuthorizedKeys) ForEach ¶ added in v0.2.0
func (this AuthorizedKeys) ForEach(consumer func(i int, key ssh.PublicKey, comment string, opts []AuthorizedKeyOption) (canContinue bool, err error)) error
func (AuthorizedKeys) Get ¶ added in v0.2.0
func (this AuthorizedKeys) Get() ([]AuthorizedKeyWithOptions, error)
func (AuthorizedKeys) IsEqualTo ¶ added in v0.2.0
func (this AuthorizedKeys) IsEqualTo(other any) bool
func (AuthorizedKeys) IsZero ¶ added in v0.2.0
func (this AuthorizedKeys) IsZero() bool
func (*AuthorizedKeys) Trim ¶ added in v0.2.0
func (this *AuthorizedKeys) Trim() error
func (AuthorizedKeys) Validate ¶ added in v0.2.0
func (this AuthorizedKeys) Validate() error
type AuthorizedKeysFile ¶ added in v0.2.0
type AuthorizedKeysFile string
func (AuthorizedKeysFile) ForEach ¶ added in v0.2.0
func (this AuthorizedKeysFile) ForEach(consumer func(i int, key ssh.PublicKey, comment string, opts []AuthorizedKeyOption) (canContinue bool, err error)) error
func (AuthorizedKeysFile) Get ¶ added in v0.2.0
func (this AuthorizedKeysFile) Get() ([]AuthorizedKeyWithOptions, error)
func (AuthorizedKeysFile) IsEqualTo ¶ added in v0.2.0
func (this AuthorizedKeysFile) IsEqualTo(other any) bool
func (AuthorizedKeysFile) IsZero ¶ added in v0.2.0
func (this AuthorizedKeysFile) IsZero() bool
func (AuthorizedKeysFile) Validate ¶ added in v0.2.0
func (this AuthorizedKeysFile) Validate() error
type DsaRestriction ¶
type DsaRestriction uint8
const ( DsaRestrictionNone DsaRestriction = iota DsaRestrictionAll DsaRestrictionAtLeast1024Bits DsaRestrictionAtLeast2048Bits DsaRestrictionAtLeast3072Bits )
func (DsaRestriction) BitsAllowed ¶
func (this DsaRestriction) BitsAllowed(in int) bool
func (DsaRestriction) IsEqualTo ¶
func (this DsaRestriction) IsEqualTo(other any) bool
func (DsaRestriction) IsZero ¶
func (this DsaRestriction) IsZero() bool
func (DsaRestriction) KeyAllowed ¶
func (this DsaRestriction) KeyAllowed(in any) (bool, error)
func (DsaRestriction) MarshalText ¶
func (this DsaRestriction) MarshalText() (text []byte, err error)
func (*DsaRestriction) Set ¶
func (this *DsaRestriction) Set(text string) error
func (DsaRestriction) String ¶
func (this DsaRestriction) String() string
func (*DsaRestriction) UnmarshalText ¶
func (this *DsaRestriction) UnmarshalText(text []byte) error
func (DsaRestriction) Validate ¶
func (this DsaRestriction) Validate() error
type EcdsaRestriction ¶
type EcdsaRestriction uint8
const ( EcdsaRestrictionNone EcdsaRestriction = iota EcdsaRestrictionAll EcdsaRestrictionAtLeast256Bits EcdsaRestrictionAtLeast384Bits EcdsaRestrictionAtLeast521Bits )
func (EcdsaRestriction) BitsAllowed ¶
func (this EcdsaRestriction) BitsAllowed(in int) bool
func (EcdsaRestriction) IsEqualTo ¶
func (this EcdsaRestriction) IsEqualTo(other any) bool
func (EcdsaRestriction) IsZero ¶
func (this EcdsaRestriction) IsZero() bool
func (EcdsaRestriction) KeyAllowed ¶
func (this EcdsaRestriction) KeyAllowed(in any) (bool, error)
func (EcdsaRestriction) MarshalText ¶
func (this EcdsaRestriction) MarshalText() (text []byte, err error)
func (*EcdsaRestriction) Set ¶
func (this *EcdsaRestriction) Set(text string) error
func (EcdsaRestriction) String ¶
func (this EcdsaRestriction) String() string
func (*EcdsaRestriction) UnmarshalText ¶
func (this *EcdsaRestriction) UnmarshalText(text []byte) error
func (EcdsaRestriction) Validate ¶
func (this EcdsaRestriction) Validate() error
type Ed25519Restriction ¶
type Ed25519Restriction uint8
const ( Ed25519RestrictionNone Ed25519Restriction = iota Ed25519RestrictionAll Ed25519RestrictionAtLeast256Bits )
func (Ed25519Restriction) BitsAllowed ¶
func (this Ed25519Restriction) BitsAllowed(in int) bool
func (Ed25519Restriction) IsEqualTo ¶
func (this Ed25519Restriction) IsEqualTo(other any) bool
func (Ed25519Restriction) IsZero ¶
func (this Ed25519Restriction) IsZero() bool
func (Ed25519Restriction) KeyAllowed ¶
func (this Ed25519Restriction) KeyAllowed(in any) (bool, error)
func (Ed25519Restriction) MarshalText ¶
func (this Ed25519Restriction) MarshalText() (text []byte, err error)
func (*Ed25519Restriction) Set ¶
func (this *Ed25519Restriction) Set(text string) error
func (Ed25519Restriction) String ¶
func (this Ed25519Restriction) String() string
func (*Ed25519Restriction) UnmarshalText ¶
func (this *Ed25519Restriction) UnmarshalText(text []byte) error
func (Ed25519Restriction) Validate ¶
func (this Ed25519Restriction) Validate() error
type EllipticCurveType ¶
type EllipticCurveType uint8
const ( EllipticCurveTypeP224 EllipticCurveType = iota EllipticCurveTypeP256 EllipticCurveTypeP384 EllipticCurveTypeP521 )
func (EllipticCurveType) String ¶
func (this EllipticCurveType) String() string
type Htpasswd ¶ added in v0.2.0
type Htpasswd struct {
// contains filtered or unexported fields
}
func (Htpasswd) MarshalText ¶ added in v0.2.0
func (*Htpasswd) UnmarshalText ¶ added in v0.2.0
type HtpasswdFile ¶ added in v0.2.0
type HtpasswdFile struct {
// contains filtered or unexported fields
}
func (HtpasswdFile) IsEqualTo ¶ added in v0.2.0
func (this HtpasswdFile) IsEqualTo(other any) bool
func (HtpasswdFile) IsZero ¶ added in v0.2.0
func (this HtpasswdFile) IsZero() bool
func (HtpasswdFile) MarshalText ¶ added in v0.2.0
func (this HtpasswdFile) MarshalText() (text []byte, err error)
func (HtpasswdFile) Match ¶ added in v0.2.0
func (this HtpasswdFile) Match(username, password string) bool
func (*HtpasswdFile) Set ¶ added in v0.2.0
func (this *HtpasswdFile) Set(text string) error
func (HtpasswdFile) String ¶ added in v0.2.0
func (this HtpasswdFile) String() string
func (*HtpasswdFile) UnmarshalText ¶ added in v0.2.0
func (this *HtpasswdFile) UnmarshalText(text []byte) error
func (HtpasswdFile) Validate ¶ added in v0.2.0
func (this HtpasswdFile) Validate() error
type KeyRequirement ¶
type KeyRequirement struct {
Type KeyType
// BitSize is used for RSA keys. Default is DefaultKeyBitSize
BitSize *int
// DsaParameterSize is used for KeyTypeDsa. Default is DefaultDsaParameterSize
DsaParameterSize *dsa.ParameterSizes
// EllipticCurveType is used for KeyTypeEcdsa. Default is DefaultEllipticCurveType
EllipticCurveType *EllipticCurveType
}
func (KeyRequirement) CreateFile ¶
func (this KeyRequirement) CreateFile(rand io.Reader, fn string) (PrivateKey, error)
func (KeyRequirement) GenerateKey ¶
func (this KeyRequirement) GenerateKey(rand io.Reader) (PrivateKey, error)
type KnownHosts ¶
type KnownHosts string
func (KnownHosts) IsEqualTo ¶
func (this KnownHosts) IsEqualTo(other any) bool
func (KnownHosts) IsZero ¶
func (this KnownHosts) IsZero() bool
func (*KnownHosts) Trim ¶
func (this *KnownHosts) Trim() error
func (KnownHosts) Validate ¶
func (this KnownHosts) Validate() error
func (KnownHosts) ValidateSyntax ¶
func (this KnownHosts) ValidateSyntax() error
type KnownHostsFile ¶
type KnownHostsFile string
func (KnownHostsFile) IsEqualTo ¶
func (this KnownHostsFile) IsEqualTo(other any) bool
func (KnownHostsFile) IsZero ¶
func (this KnownHostsFile) IsZero() bool
func (*KnownHostsFile) Trim ¶
func (this *KnownHostsFile) Trim() error
func (KnownHostsFile) Validate ¶
func (this KnownHostsFile) Validate() error
type ObjectId ¶ added in v0.4.0
type ObjectId uint8
func (*ObjectId) FromNative ¶ added in v0.4.0
func (this *ObjectId) FromNative(in asn1.ObjectIdentifier) error
func (ObjectId) MarshalText ¶ added in v0.4.0
func (ObjectId) ToNative ¶ added in v0.4.0
func (this ObjectId) ToNative() (asn1.ObjectIdentifier, error)
func (ObjectId) ToNativeDirect ¶ added in v0.4.0
func (this ObjectId) ToNativeDirect() asn1.ObjectIdentifier
func (*ObjectId) UnmarshalText ¶ added in v0.4.0
type Password ¶ added in v0.2.0
type Password []byte
func (Password) MarshalText ¶ added in v0.2.0
func (*Password) SetPassword ¶ added in v0.2.0
func (this *Password) SetPassword(t PasswordType, password []byte) error
func (*Password) UnmarshalText ¶ added in v0.2.0
type PasswordFile ¶ added in v0.4.0
type PasswordFile string
func (PasswordFile) GetPassword ¶ added in v0.4.0
func (this PasswordFile) GetPassword() (Password, error)
func (PasswordFile) IsEqualTo ¶ added in v0.4.0
func (this PasswordFile) IsEqualTo(other any) bool
func (PasswordFile) IsZero ¶ added in v0.4.0
func (this PasswordFile) IsZero() bool
func (PasswordFile) MarshalText ¶ added in v0.4.0
func (this PasswordFile) MarshalText() ([]byte, error)
func (*PasswordFile) Set ¶ added in v0.4.0
func (this *PasswordFile) Set(plain string) error
func (PasswordFile) SetPassword ¶ added in v0.4.0
func (this PasswordFile) SetPassword(v Password) error
func (PasswordFile) String ¶ added in v0.4.0
func (this PasswordFile) String() string
func (*PasswordFile) UnmarshalText ¶ added in v0.4.0
func (this *PasswordFile) UnmarshalText(b []byte) error
func (PasswordFile) Validate ¶ added in v0.4.0
func (this PasswordFile) Validate() error
type PasswordType ¶ added in v0.2.0
type PasswordType uint8
const ( PasswordTypePlain PasswordType = iota PasswordTypeBcrypt )
func (PasswordType) Compare ¶ added in v0.2.0
func (this PasswordType) Compare(encoded, password []byte) (bool, error)
func (PasswordType) Encode ¶ added in v0.2.0
func (this PasswordType) Encode(password []byte) ([]byte, error)
func (PasswordType) IsEqualTo ¶ added in v0.2.0
func (this PasswordType) IsEqualTo(other any) bool
func (PasswordType) MarshalText ¶ added in v0.2.0
func (this PasswordType) MarshalText() ([]byte, error)
func (*PasswordType) Set ¶ added in v0.2.0
func (this *PasswordType) Set(plain string) error
func (PasswordType) String ¶ added in v0.2.0
func (this PasswordType) String() string
func (*PasswordType) UnmarshalText ¶ added in v0.2.0
func (this *PasswordType) UnmarshalText(b []byte) error
func (PasswordType) Validate ¶ added in v0.2.0
func (this PasswordType) Validate() error
type PrivateKey ¶ added in v0.4.0
type PrivateKey interface {
Type() string
PublicKey() PublicKey
ToSsh() ssh.Signer
ToSdk() gocrypto.Signer
MarshalPemBlock() (*pem.Block, error)
}
func EnsureKeyFile ¶
func EnsureKeyFile(fn string, reqOnAbsence *KeyRequirement, rand io.Reader) (PrivateKey, error)
func LoadSecurePrivateKeyFile ¶
func LoadSecurePrivateKeyFile(path string, maximumSize int64) (PrivateKey, error)
LoadSecurePrivateKeyFile loads an existing private key without creating or replacing it. The path must identify one stable, privately owned regular file throughout the read.
func ParsePrivateKeyBytes ¶
func ParsePrivateKeyBytes(raw []byte) (PrivateKey, error)
func PrivateKeyFromSdk ¶ added in v0.4.0
func PrivateKeyFromSdk(sdk gocrypto.Signer) (PrivateKey, error)
type PublicKey ¶ added in v0.4.0
type PublicKey interface {
Type() string
Marshal() []byte
ToSsh() ssh.PublicKey
ToSdk() gocrypto.PublicKey
IsEqualTo(PublicKey) bool
}
func ParsePublicKeyBytes ¶ added in v0.4.0
func PublicKeyFromSdk ¶ added in v0.4.0
type PublicKeys ¶
type PublicKeys string
func (PublicKeys) IsEqualTo ¶
func (this PublicKeys) IsEqualTo(other any) bool
func (PublicKeys) IsZero ¶
func (this PublicKeys) IsZero() bool
func (*PublicKeys) Trim ¶
func (this *PublicKeys) Trim() error
func (PublicKeys) Validate ¶
func (this PublicKeys) Validate() error
type PublicKeysFile ¶
type PublicKeysFile string
func (PublicKeysFile) Get ¶
func (this PublicKeysFile) Get() ([]ssh.PublicKey, error)
Get materializes at most 4 MiB of public keys. Use ForEach for larger files.
func (PublicKeysFile) IsEqualTo ¶
func (this PublicKeysFile) IsEqualTo(other any) bool
func (PublicKeysFile) IsZero ¶
func (this PublicKeysFile) IsZero() bool
func (*PublicKeysFile) Trim ¶
func (this *PublicKeysFile) Trim() error
func (PublicKeysFile) Validate ¶
func (this PublicKeysFile) Validate() error
type RsaRestriction ¶
type RsaRestriction uint8
const ( RsaRestrictionNone RsaRestriction = iota RsaRestrictionAll RsaRestrictionAtLeast1024Bits RsaRestrictionAtLeast2048Bits RsaRestrictionAtLeast3072Bits RsaRestrictionAtLeast4096Bits )
func (RsaRestriction) BitsAllowed ¶
func (this RsaRestriction) BitsAllowed(in int) bool
func (RsaRestriction) IsEqualTo ¶
func (this RsaRestriction) IsEqualTo(other any) bool
func (RsaRestriction) IsZero ¶
func (this RsaRestriction) IsZero() bool
func (RsaRestriction) KeyAllowed ¶
func (this RsaRestriction) KeyAllowed(in any) (bool, error)
func (RsaRestriction) MarshalText ¶
func (this RsaRestriction) MarshalText() (text []byte, err error)
func (*RsaRestriction) Set ¶
func (this *RsaRestriction) Set(text string) error
func (RsaRestriction) String ¶
func (this RsaRestriction) String() string
func (*RsaRestriction) UnmarshalText ¶
func (this *RsaRestriction) UnmarshalText(text []byte) error
func (RsaRestriction) Validate ¶
func (this RsaRestriction) Validate() error
Source Files
¶
- age-ssh.go
- authorized-keys-file.go
- authorized-keys-option-type.go
- authorized-keys-option.go
- authorized-keys.go
- bootstrap-file_linux.go
- bootstrap-host-key.go
- bootstrap-lock_unix.go
- bootstrap.go
- ca-certs.go
- curve-type.go
- dsa-restriction.go
- ecdsa-restriction.go
- ed25519-restriction.go
- engity-object-id.go
- htpasswd-file.go
- htpasswd.go
- key-file_linux.go
- key-read_unix.go
- key-requirement.go
- key-type.go
- key.go
- known-hosts.go
- object-id.go
- password-bcrypt.go
- password-file.go
- password-type.go
- password.go
- protected-temp-file_unix.go
- protected-temp.go
- public-keys-file.go
- public-keys.go
- restriction.go
- rsa-restriction.go
- secure-private-key-file.go
- secure-private-key-file_unix.go
- ssh.go
Click to show internal directories.
Click to hide internal directories.