Skip to content
Snippets Groups Projects
Select Git revision
  • e96972303b84e84b7e8b3ea8299644bf89b4facd
  • ballinvoher default protected
  • client-http-server-for-token
  • master
  • gitlab-auth-issue
  • windows
  • microsoft
  • message
  • azure_auth
  • prometheus
  • permission-templates
  • no-datastore
  • save-public-keys
  • gitlab-group-level-start
  • v1.1.0
  • v1.0.0
  • v0.1
17 results

util.go

Blame
  • user avatar
    Niall Sheridan authored
    e8ff7ffe
    History
    util.go 259 B
    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]
    }