Documentation
¶
Overview ¶
The sshcert package provides convenience functions for dealing with SSH certificates
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddedKey ¶ added in v0.21.0
func AddedKey(key any, cert *ssh.Certificate) agent.AddedKey
AddedKey returns the SSH key to be added to the Agent On non-Windows platforms this includes LifetimeSecs that aligns with the certificate expiry time
func ParseCert ¶
func ParseCert(certBytes []byte) (*ssh.Certificate, error)
ParseCert will parse the provided byte slice (in OpenSSH certificate format) and return a *ssh.Certificate.
Only the first certificate in certBytes is parsed and any remaining data is ignored.
Any parsing errors will result in a nil *ssh.Certificate returned along with the error.
func RemoveFromAgent ¶ added in v0.24.0
func RemoveFromAgent(a agent.Agent, cert *ssh.Certificate) error
RemoveFromAgent removes cert from the agent a, leaving any other identities (such as the plain private key for the certificate) in place. It does nothing if the agent does not hold cert.
func RemoveStale ¶ added in v0.27.0
RemoveStale removes every stale certificate from the agent a: user certificates signed by ca that expired at or before now. Plain keys, host certificates, certificates from other CAs and certificates that have not expired are left in place.
The certificates that were removed are returned. A failure to remove one certificate does not stop the others being removed and all failures are returned together.
Types ¶
This section is empty.