MCPcopy Index your code
hub / github.com/getsops/sops / parseSSHIdentityFromPrivateKeyCmdOutput

Function parseSSHIdentityFromPrivateKeyCmdOutput

age/keysource.go:577–586  ·  view source on GitHub ↗

parseSSHIdentityFromPrivateKeyCmdOutput returns an age.Identity from the given private key. Note that encrypted private keys are not supported.

(key []byte)

Source from the content-addressed store, hash-verified

575// parseSSHIdentityFromPrivateKeyCmdOutput returns an age.Identity from the given
576// private key. Note that encrypted private keys are not supported.
577func parseSSHIdentityFromPrivateKeyCmdOutput(key []byte) (age.Identity, error) {
578 id, err := agessh.ParseIdentity(key)
579 if sshErr, ok := err.(*ssh.PassphraseMissingError); ok {
580 return nil, fmt.Errorf("the SSH key returned by running SOPS_AGE_SSH_PRIVATE_KEY_CMD is password protected, which is unsupported. (%q)", sshErr)
581 }
582 if err != nil {
583 return nil, fmt.Errorf("malformed SSH identity returned by running SOPS_AGE_SSH_PRIVATE_KEY_CMD: %q", err)
584 }
585 return id, nil
586}

Callers 1

loadAgeSSHIdentitiesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected