tailcfg: move NodeKey type to types/key.

This leaves behind a type alias and associated constructor, to allow
for gradual switchover.

Updates #3206.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-10-29 16:02:38 -07:00
parent 15d329b4fa
commit ff16e58d23
5 changed files with 121 additions and 77 deletions

View File

@@ -307,3 +307,10 @@ func (k NodePublic) WireGuardGoString() string {
b[second+3] = b64((k.k[31] << 2) & 63)
return string(b)
}
// AsNodeKey returns k converted to a NodeKey.
//
// Cross-compatibility shim as part of #3206.
func (k NodePublic) AsNodeKey() NodeKey {
return k.Raw32()
}