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

Function parseDSA

internal/sshutil/sshutil.go:139–157  ·  view source on GitHub ↗

parseDSA parses an DSA key according to RFC 4253, section 6.6.

(in []byte)

Source from the content-addressed store, hash-verified

137
138// parseDSA parses an DSA key according to RFC 4253, section 6.6.
139func parseDSA(in []byte) (*dsa.PublicKey, error) {
140 var w struct {
141 P, Q, G, Y *big.Int
142 Rest []byte `ssh:"rest"`
143 }
144 if err := ssh.Unmarshal(in, &w); err != nil {
145 return nil, errors.Wrap(err, "error unmarshaling public key")
146 }
147
148 param := dsa.Parameters{
149 P: w.P,
150 Q: w.Q,
151 G: w.G,
152 }
153 return &dsa.PublicKey{
154 Parameters: param,
155 Y: w.Y,
156 }, nil
157}
158
159// parseRSA parses an RSA key according to RFC 4253, section 6.6.
160func parseRSA(in []byte) (*rsa.PublicKey, error) {

Callers 2

PublicKeyFunction · 0.85
publicKeyTypeAndSizeFunction · 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…