sshcert

package
v0.27.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func RemoveStale(a agent.Agent, ca ssh.PublicKey, now time.Time) ([]*ssh.Certificate, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL