blob: ca88f3fddf1f14d5a0e49fa973551c2c8391a987 (
plain)
1
2
3
4
5
6
7
8
9
10
|
package lib
import "golang.org/x/crypto/ssh"
// GetPublicKey marshals a ssh certificate to a string.
func GetPublicKey(pub ssh.PublicKey) []byte {
marshaled := ssh.MarshalAuthorizedKey(pub)
// Strip trailing newline
return marshaled[:len(marshaled)-1]
}
|