Documentation ¶
Index ¶
Constants ¶
Cipher names. I believe only AES256-CTR is supported upstream currently.
Key types.
KDF names. I believe only bcrypt is supported upstream currently.
View Source
const (
KeyV1Magic string = "openssh-key-v1"
)
Needed for V1 key format.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedSSHKeyV1 ¶
type EncryptedSSHKeyV1 struct { SSHKeyV1 Crypt SSHCrypt KDFOpts SSHKDFOpts Passphrase []byte }
EncryptedSSHKeyV1 represents an encrypted private key.
func (*EncryptedSSHKeyV1) Generate ¶
func (k *EncryptedSSHKeyV1) Generate(force bool) error
type SSHCrypt ¶
type SSHCrypt struct { Stream cipher.Stream Cipher cipher.Block PrivateKey []byte // encryption key CryptSalt []byte // ephemeral salt CryptKey []byte // ephemeral key (not really used) }
SSHCrypt contains the encryption object Stream, the cipher object Cipher, the ephemeral salt (CryptSalt), and the ephemeral key (CryptKey). the Cipher, and the stream.
type SSHKDFOpts ¶
type SSHKDFOpts struct { Salt []byte // Also referred to as IV (initialization vector). (https://en.wikipedia.org/wiki/Initialization_vector) Rounds uint32 // Also referred to as work factor. }
SSHKDFOpts contains a set of KDF options.
type SSHKeyV1 ¶
type SSHKeyV1 struct { Magic string DefKeyType string KDFName string CipherName string KeySize uint32 Keys []SSHPrivKey // 1 by default. Buffer bytes.Buffer }
SSHKeyV1 represents a private key. We don't bother with the legacy (pre v1) keys. Sorry not sorry. Patch your shit.
type SSHPrivKey ¶
type SSHPrivKey struct { PublicKey *SSHPubKey BitSize uint32 BlockSize int Key interface{} // ED25519 keys are actually "sk + pk", where sk is the secret key and pk is the pubkey. // We store that here. KeyAlt []byte Checksum []byte Comment string }
SSHPrivKey contains the Private key of an SSH Keypair.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.