aboutsummaryrefslogtreecommitdiff
path: root/cmd/cashier/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/cashier/client/client.go')
-rw-r--r--cmd/cashier/client/client.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/cashier/client/client.go b/cmd/cashier/client/client.go
index d8def27..ba5b900 100644
--- a/cmd/cashier/client/client.go
+++ b/cmd/cashier/client/client.go
@@ -78,12 +78,14 @@ func send(s []byte, token, ca string, ValidateTLSCertificate bool) (*lib.SignRes
return c, nil
}
+// Sign sends the public key to the CA to be signed.
func Sign(pub ssh.PublicKey, token string, conf *Config) (*ssh.Certificate, error) {
validity, err := time.ParseDuration(conf.Validity)
if err != nil {
return nil, err
}
marshaled := ssh.MarshalAuthorizedKey(pub)
+ // Remove the trailing newline.
marshaled = marshaled[:len(marshaled)-1]
s, err := json.Marshal(&lib.SignRequest{
Key: string(marshaled),