Do you mean a cert from a file such as one generated by openssh? Something like id_rsa-cert.pub?If so, then you most likely want ParseAuthorizedKey.If the cert is in memory or stored in a database as just the key/cert bytes and is not base64 encoded, then this may be what you want.ParseAuthorizedKey eventually calls ParsePublicKey after doing the base64 decoding (and also stripping off newlines, the leading format string, and the trailing comment commonly found in the file).
I'm apparently very bad at google groups, apologies ahead of time if you get a double posting from my work address.
On Wednesday, July 8, 2015 at 6:37:32 PM UTC-7, Jonathan Pittman wrote:Do you mean a cert from a file such as one generated by openssh? Something like id_rsa-cert.pub?If so, then you most likely want ParseAuthorizedKey.If the cert is in memory or stored in a database as just the key/cert bytes and is not base64 encoded, then this may be what you want.ParseAuthorizedKey eventually calls ParsePublicKey after doing the base64 decoding (and also stripping off newlines, the leading format string, and the trailing comment commonly found in the file).I'm probably missing something obvious, but I'm looking to end up with an ssh.Certificate struct that I can pass to agent.Add() to load into a running ssh-agent. ParsePublicKey appears to return a publickey who's Type() method return ssh-rsa-...@openssh.com, but I can't seem to figure out how to turn that publickey into a struct ssh.Certificate.
Cheers,peterOn Tuesday, July 7, 2015 at 7:12:54 PM UTC-6, Peter Moody wrote:I can see how to easily generate new signed ssh certificates, but I can't figure out how to load previously generated certs using go. What's the correct way to load a previously signed ssh cert in go?Cheers
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/EwcZSZZMsko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Do you mean a cert from a file such as one generated by openssh? Something like id_rsa-cert.pub?If so, then you most likely want ParseAuthorizedKey.If the cert is in memory or stored in a database as just the key/cert bytes and is not base64 encoded, then this may be what you want.ParseAuthorizedKey eventually calls ParsePublicKey after doing the base64 decoding (and also stripping off newlines, the leading format string, and the trailing comment commonly found in the file).