MCPcopy Index your code
hub / github.com/tailscale/tailscale / ID

Method ID

tka/key.go:85–94  ·  view source on GitHub ↗

ID returns the KeyID of the key.

()

Source from the content-addressed store, hash-verified

83
84// ID returns the KeyID of the key.
85func (k Key) ID() (tkatype.KeyID, error) {
86 switch k.Kind {
87 // Because 25519 public keys are so short, we just use the 32-byte
88 // public as their 'key ID'.
89 case Key25519:
90 return tkatype.KeyID(k.Public), nil
91 default:
92 return nil, fmt.Errorf("unknown key kind: %v", k.Kind)
93 }
94}
95
96// Ed25519 returns the ed25519 public key encoded by Key. An error is
97// returned for keys which do not represent ed25519 public keys.

Callers 15

MustIDMethod · 0.95
sign25519Method · 0.95
TestFindParentForRewriteFunction · 0.95
peerChangeDiffFunction · 0.45
sortedPeersMethod · 0.45
PeerIndexByNodeIDMethod · 0.45
ConciseDiffFromMethod · 0.45
TestPeerIndexByNodeIDFunction · 0.45
NodeIDBeingMutatedMethod · 0.45

Calls 2

KeyIDTypeAlias · 0.92
ErrorfMethod · 0.65

Tested by 12

TestFindParentForRewriteFunction · 0.76
TestPeerIndexByNodeIDFunction · 0.36
peerStatusFromNodeFunction · 0.36
TestRefreshFunction · 0.36
TestRoutersByPrefixFunction · 0.36
PingMethod · 0.36
FuzzSortNodesFunction · 0.36
TestNetmapDeltaFastPathFunction · 0.36