MCPcopy Create free account
hub / github.com/tailscale/tailcat / nodeKeyLocked

Method nodeKeyLocked

tailcat.go:1440–1449  ·  view source on GitHub ↗

nodeKeyLocked returns the client's effective node private key, resolving it from the Key field (or generating a fresh one) on first use. c.startMu must be held.

()

Source from the content-addressed store, hash-verified

1438// resolving it from the Key field (or generating a fresh one) on
1439// first use. c.startMu must be held.
1440func (c *Client) nodeKeyLocked() key.NodePrivate {
1441 if c.key.IsZero() {
1442 if !c.Key.IsZero() {
1443 c.key = c.Key
1444 } else {
1445 c.key = key.NewNode()
1446 }
1447 }
1448 return c.key
1449}
1450
1451// NewClient returns a client that will connect to the server
1452// identified by the given token. It is shorthand for

Callers 2

initLockedMethod · 0.95
PublicKeyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected