Versions in this module Expand all Collapse all v1 v1.0.1 May 8, 2026 Changes in this version + var DefaultOpenSSHOpts = ssh.DefaultOpts + var ErrKeyMustBePEMEncoded = errors.New("go-cryptobin/ssh: invalid key: Key must be a PEM encoded OpenSSH key") + var ErrNotOpenSSHPublicKey = errors.New("go-cryptobin/ssh: key is not a valid SSH public key") + var ErrPrivateKeyError = errors.New("go-cryptobin/ssh: key is not a valid private key") + var ErrPublicKeyError = errors.New("go-cryptobin/ssh: key is not a valid public key") + var GetCipherFromName = pkcs8.GetCipherFromName + var GetHashFromName = pkcs8.GetHashFromName + var GetOpenSSHCipherFromName = ssh.GetCipherFromName + type OpenSSHBcryptOpts = ssh.BcryptOpts + type OpenSSHBcryptbinOpts = ssh.BcryptbinOpts + type OpenSSHOpts = ssh.Opts + type Options struct + Bits int + CipherName string + Comment string + Curve elliptic.Curve + ParameterSizes dsa.ParameterSizes + PublicKeyType PublicKeyType + type Opts = pkcs8.Opts + type PBKDF2Opts = pkcs8.PBKDF2Opts + type PublicKeyType uint + const KeyTypeDSA + const KeyTypeECDSA + const KeyTypeEdDSA + const KeyTypeRSA + const KeyTypeSM2 + const KeyTypeUnknown + func (typ PublicKeyType) String() string + type SSH struct + Errors []error + func FromBase64String(data string) SSH + func FromBytes(data []byte) SSH + func FromHexString(data string) SSH + func FromOpenSSHPrivateKey(key []byte) SSH + func FromOpenSSHPrivateKeyWithPassword(key []byte, password []byte) SSH + func FromOpenSSHPublicKey(key []byte) SSH + func FromPrivateKey(key []byte) SSH + func FromPrivateKeyWithPassword(key []byte, password []byte) SSH + func FromPublicKey(key []byte) SSH + func FromString(data string) SSH + func GenerateKey(options ...Options) SSH + func GenerateKeyWithSeed(reader io.Reader, options ...Options) SSH + func New() SSH + func NewSSH() SSH + func (this SSH) AppendError(err ...error) SSH + func (this SSH) CheckKeyPair() bool + func (this SSH) CreateOpenSSHPrivateKey() SSH + func (this SSH) CreateOpenSSHPrivateKeyWithPassword(password []byte, opts ...OpenSSHOpts) SSH + func (this SSH) CreateOpenSSHPublicKey() SSH + func (this SSH) CreatePrivateKey() SSH + func (this SSH) CreatePrivateKeyWithPassword(password []byte, opts ...any) SSH + func (this SSH) CreatePublicKey() SSH + func (this SSH) Error() error + func (this SSH) FromBase64String(data string) SSH + func (this SSH) FromBytes(data []byte) SSH + func (this SSH) FromHexString(data string) SSH + func (this SSH) FromOpenSSHPrivateKey(key []byte) SSH + func (this SSH) FromOpenSSHPrivateKeyWithPassword(key []byte, password []byte) SSH + func (this SSH) FromOpenSSHPublicKey(key []byte) SSH + func (this SSH) FromPrivateKey(key []byte) SSH + func (this SSH) FromPrivateKeyWithPassword(key []byte, password []byte) SSH + func (this SSH) FromPublicKey(key []byte) SSH + func (this SSH) FromString(data string) SSH + func (this SSH) GenerateKey() SSH + func (this SSH) GenerateKeyWithSeed(reader io.Reader) SSH + func (this SSH) GetBits() int + func (this SSH) GetCipherName() string + func (this SSH) GetComment() string + func (this SSH) GetCurve() elliptic.Curve + func (this SSH) GetData() []byte + func (this SSH) GetErrors() []error + func (this SSH) GetKeyData() []byte + func (this SSH) GetOpenSSHPublicKey() (ssh.PublicKey, error) + func (this SSH) GetOpenSSHSigner() (ssh.Signer, error) + func (this SSH) GetOptions() Options + func (this SSH) GetParameterSizes() dsa.ParameterSizes + func (this SSH) GetParsedData() []byte + func (this SSH) GetPrivateKey() crypto.PrivateKey + func (this SSH) GetPrivateKeyType() PublicKeyType + func (this SSH) GetPublicKey() crypto.PublicKey + func (this SSH) GetPublicKeyType() PublicKeyType + func (this SSH) GetVerify() bool + func (this SSH) MakePublicKey() SSH + func (this SSH) OnError(fn func([]error)) SSH + func (this SSH) ParseOpenSSHPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, string, string, error) + func (this SSH) ParseOpenSSHPrivateKeyFromPEMWithPassword(key []byte, password []byte) (crypto.PrivateKey, string, string, error) + func (this SSH) ParseOpenSSHPrivateKeyToInfoFromPEM(key []byte) (openSSHPrivateKey, error) + func (this SSH) ParseOpenSSHPublicKeyFromPEM(key []byte) (crypto.PublicKey, string, error) + func (this SSH) ParsePKCS8PrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) + func (this SSH) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password []byte) (crypto.PrivateKey, error) + func (this SSH) ParsePKCS8PublicKeyFromPEM(key []byte) (crypto.PublicKey, error) + func (this SSH) SetCipher(cip cryptobin_ssh.Cipher) SSH + func (this SSH) SetCurve(curve string) SSH + func (this SSH) SetGenerateType(typ string) SSH + func (this SSH) SetOpenSSHPublicKey(key ssh.PublicKey) SSH + func (this SSH) SetParameterSizes(ln string) SSH + func (this SSH) SetPublicKeyType(keyType string) SSH + func (this SSH) Sign() SSH + func (this SSH) ToBase64String() string + func (this SSH) ToBytes() []byte + func (this SSH) ToHexString() string + func (this SSH) ToKeyBytes() []byte + func (this SSH) ToKeyString() string + func (this SSH) ToString() string + func (this SSH) ToVerify() bool + func (this SSH) ToVerifyInt() int + func (this SSH) Verify(data []byte) SSH + func (this SSH) WithBits(bits int) SSH + func (this SSH) WithCipherName(cipherName string) SSH + func (this SSH) WithComment(comment string) SSH + func (this SSH) WithCurve(curve elliptic.Curve) SSH + func (this SSH) WithData(data []byte) SSH + func (this SSH) WithErrors(errs []error) SSH + func (this SSH) WithKeyData(data []byte) SSH + func (this SSH) WithOptions(options Options) SSH + func (this SSH) WithParameterSizes(sizes dsa.ParameterSizes) SSH + func (this SSH) WithParsedData(data []byte) SSH + func (this SSH) WithPrivateKey(key crypto.PrivateKey) SSH + func (this SSH) WithPublicKey(key crypto.PublicKey) SSH + func (this SSH) WithPublicKeyType(keyType PublicKeyType) SSH + func (this SSH) WithVerify(data bool) SSH + type ScryptOpts = pkcs8.ScryptOpts