Open louiseohalloran opened 5 years ago
There are functions documented at https://masterminds.github.io/sprig/crypto.html that might help. These include examples.
Thanks @mattfarina, I did have a look there but I think there is no function to create the public and private key pair generated when you run ssh-keygen ( id_rsa, id_rsa.pub )
I think something like https://gist.github.com/devinodaniel/8f9b8a4f31573f428f29ec0e884e6673#file-gistfile1-txt-L81 would be needed
Anyone have a solution for this? I need to mount a public key file to a Kubernetes pod without mounting the private key portion.
You can generate a private key (which includes the public key) like this : https://play.golang.org/p/I4NIZ-xY1w0
However, the function to get the public key (getPublicKey) seems not to be exposed. https://github.com/Masterminds/sprig/blob/master/crypto.go#L258 It also maybe wants a "PrivateKey" type object not the string that the private key returns.
that could be awesome to create ssh keyPair !!
Hi Can you tell me if there is any way to generate public and private ssh rsa keys using sprig
I mean the equivalent to running ssh-keygen ?
Thanks