Documentation
¶
Index ¶
- Constants
- Variables
- func DoWithEachAuthorizedKey[R any](requireExistence bool, ...) (result R, err error)
- func EnsureKeyFile(fn string, reqOnAbsence *KeyRequirement, rand io.Reader) (crypto.Signer, error)
- func WriteSshPrivateKey(pk crypto.Signer, to io.Writer) error
- 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 KeyRequirement
- type KeyType
- 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 )
Variables ¶
View Source
var (
DefaultDsaRestriction = DsaRestrictionNone
)
View Source
var (
DefaultEcdsaRestriction = EcdsaRestrictionAtLeast384Bits
)
View Source
var (
DefaultEd25519Restriction = Ed25519RestrictionAll
)
View Source
var (
DefaultRsaRestriction = RsaRestrictionAtLeast4096Bits
)
Functions ¶
func DoWithEachAuthorizedKey ¶
func EnsureKeyFile ¶
Types ¶
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 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 (KeyRequirement) GenerateKey ¶
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
¶
Click to show internal directories.
Click to hide internal directories.