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

Function isSSHPublicKey

command/crypto/key/format.go:288–300  ·  view source on GitHub ↗
(in []byte)

Source from the content-addressed store, hash-verified

286}
287
288func isSSHPublicKey(in []byte) bool {
289 switch {
290 case bytes.HasPrefix(in, []byte(ssh.KeyAlgoRSA)),
291 bytes.HasPrefix(in, []byte(ssh.InsecureKeyAlgoDSA)), //nolint:staticcheck // compatibility with older tooling
292 bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA256)),
293 bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA384)),
294 bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA521)),
295 bytes.HasPrefix(in, []byte(ssh.KeyAlgoED25519)):
296 return true
297 default:
298 return false
299 }
300}
301
302func isJWK(in []byte) bool {
303 if bytes.HasPrefix(in, []byte("{")) {

Callers 3

inspectActionFunction · 0.85
formatActionFunction · 0.85
fingerprintActionFunction · 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…