aboutsummaryrefslogtreecommitdiff
path: root/server/util/util.go
blob: 10f5eca6e3152e51dcc2b9ef3cd94c9d77c38b9e (plain)
1
2
3
4
5
6
7
8
9
10
package util

import "golang.org/x/crypto/ssh"

// GetPublicKey marshals a ssh certificate to a string.
func GetPublicKey(cert *ssh.Certificate) string {
	marshaled := ssh.MarshalAuthorizedKey(cert)
	// Strip trailing newline
	return string(marshaled[:len(marshaled)-1])
}