aboutsummaryrefslogtreecommitdiff
path: root/lib/util.go
blob: b1c7b87016343712bcbbb534cfbecef733a083e6 (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) string {
	marshaled := ssh.MarshalAuthorizedKey(pub)
	// Strip trailing newline
	return string(marshaled[:len(marshaled)-1])
}