MCPcopy Index your code
hub / github.com/devspace-sh/devspace / MakeSSHKeyPair

Function MakeSSHKeyPair

pkg/devspace/services/ssh/keys.go:69–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69func MakeSSHKeyPair() (string, string, error) {
70 privateKey, privKeyStr, err := generatePrivateKey()
71 if err != nil {
72 return "", "", err
73 }
74
75 // generate and write public key
76 pub, err := ssh.NewPublicKey(&privateKey.PublicKey)
77 if err != nil {
78 return "", "", err
79 }
80
81 var pubKeyBuf strings.Builder
82 pubKeyBuf.Write(ssh.MarshalAuthorizedKey(pub))
83 return pubKeyBuf.String(), privKeyStr, nil
84}
85
86func getHostKey() (string, error) {
87 keyLock.Lock()

Callers 2

startLocalSSHFunction · 0.92
getPublicKeyFunction · 0.85

Calls 3

generatePrivateKeyFunction · 0.85
WriteMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected