MCPcopy Index your code
hub / github.com/smallstep/cli / ParseCertificate

Function ParseCertificate

internal/sshutil/sshutil.go:35–45  ·  view source on GitHub ↗

ParseCertificate returns a certificate from the marshaled bytes.

(in []byte)

Source from the content-addressed store, hash-verified

33
34// ParseCertificate returns a certificate from the marshaled bytes.
35func ParseCertificate(in []byte) (*ssh.Certificate, error) {
36 pub, err := ssh.ParsePublicKey(in)
37 if err != nil {
38 return nil, errors.Wrap(err, "error parsing certificate")
39 }
40 cert, ok := pub.(*ssh.Certificate)
41 if !ok {
42 return nil, errors.Errorf("error parsing certificate: %T is not a certificate", pub)
43 }
44 return cert, nil
45}
46
47// PublicKey returns the Go's crypto.PublicKey of an ssh.PublicKey.
48func PublicKey(key ssh.PublicKey) (crypto.PublicKey, error) {

Callers 4

WithSignatureKeyFunction · 0.85
WithCertsOnlyFunction · 0.85
WithRemoveExpiredCertsFunction · 0.85
ListCertificatesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…