MCPcopy
hub / github.com/tailscale/tailscale / ParseNodePublicUntyped

Function ParseNodePublicUntyped

types/key/node.go:194–200  ·  view source on GitHub ↗

ParseNodePublicUntyped parses an untyped 64-character hex value as a NodePublic. Deprecated: this function is risky to use, because it cannot verify that the hex string was intended to be a NodePublic. This can lead to accidentally decoding one type of key as another. For new uses that don't requir

(raw mem.RO)

Source from the content-addressed store, hash-verified

192// uses that don't require backwards compatibility with the untyped
193// string format, please use MarshalText/UnmarshalText.
194func ParseNodePublicUntyped(raw mem.RO) (NodePublic, error) {
195 var ret NodePublic
196 if err := parseHex(ret.k[:], raw, mem.B(nil)); err != nil {
197 return NodePublic{}, err
198 }
199 return ret, nil
200}
201
202// NodePublicFromRaw32 parses a 32-byte raw value as a NodePublic.
203//

Callers 10

nkFromHexFunction · 0.92
TestLoggerFunction · 0.92
ParseEndpointMethod · 0.92
parseMetaCertFunction · 0.92
initFunction · 0.92

Calls 1

parseHexFunction · 0.85

Tested by 7

nkFromHexFunction · 0.74
TestLoggerFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…