sshpiper/vendor/github.com/gokyle/sshkey
2018-12-29 06:13:15 +00:00
..
readpass add genkey tools 2018-12-29 06:13:15 +00:00
testdata add genkey tools 2018-12-29 06:13:15 +00:00
doc.go add genkey tools 2018-12-29 06:13:15 +00:00
LICENSE add genkey tools 2018-12-29 06:13:15 +00:00
password.go add genkey tools 2018-12-29 06:13:15 +00:00
password_unix.go add genkey tools 2018-12-29 06:13:15 +00:00
README add genkey tools 2018-12-29 06:13:15 +00:00
sshkey.go add genkey tools 2018-12-29 06:13:15 +00:00
sshkey_test.go add genkey tools 2018-12-29 06:13:15 +00:00
TODO add genkey tools 2018-12-29 06:13:15 +00:00

sshkey: a small package for loading OpenSSH ECDSA and RSA keys.

The key may be loaded via file, HTTP(S), or as byte slices.

Example:

    pub, keytype, err := sshkey.LoadPublicKeyFile("/home/user/.ssh/id_rsa.pub", false)
    switch keytype {
    case KEY_RSA: doSomethingRSA(pub.(*rsa.PublicKey))
    case KEY_ECDSA: doSomethingEC(pub.(*ecdsa.PublicKey))
    default: // unknown key type
    }

    priv, keytype, err := sshkey.LoadPrivateKeyFile("/home/user/.ssh/id_rsa")
    switch keytype {
    case KEY_RSA: doSomethingSecretRSA(pub.(*rsa.PrivateKey))
    case KEY_ECDSA: doSomethingSecretEC(pub.(*ecdsa.PrivateKey))
    default: // unknown key type
    }

License:
sshkey is released under an ISC license.