parsePubKey (ssh/keys.go)

tailscale · tempfork/sshtest/ssh/keys.go · go · BSD-3-Clause
security

Parses SSH public keys and authorized_keys entries for use in SSH authentication.

// Source: https://github.com/tailscale/tailscale | License: BSD-3-Clause | Copyright 2020 Tailscale Inc & contributors
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package ssh

import (
	"bytes"
	"crypto"
	"crypto/dsa"
	"crypto/ecdsa"
	"crypto/ed25519"
	"crypto/elliptic"
	"crypto/md5"
	"crypto/rand"
	"crypto/rsa"
	"crypto/sha256"
	"crypto/x509"
	"encoding/asn1"
	"encoding/base64"
	"encoding/binary"
	"encoding/hex"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	"math/big"
	"strings"
)

// Public key algorithms names. These values can appear in PublicKey.Type,
// ClientConfig.HostKeyAlgorithms, Signature.Format, or as Al

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key