types/key: add NodePrivate.Raw32 and DiscoPrivateFromRaw32
Raw byte accessors for key types, mirroring existing patterns (NodePublic.Raw32 and DiscoPublicFromRaw32 already exist). NodePrivate.Raw32 returns the raw 32 bytes of a node private key. DiscoPrivateFromRaw32 parses a 32-byte raw value as a DiscoPrivate. Updates tailscale/corp#24454 Change-Id: Ibc08bed14ab359eddefbebd811c375b6365c7919 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
32adca78f1
commit
525f7a1e47
@@ -61,6 +61,9 @@ func NewNode() NodePrivate {
|
||||
return ret
|
||||
}
|
||||
|
||||
// Raw32 returns k as 32 raw bytes.
|
||||
func (k NodePrivate) Raw32() [32]byte { return k.k }
|
||||
|
||||
// NodePrivateFromRaw32 parses a 32-byte raw value as a NodePrivate.
|
||||
//
|
||||
// Deprecated: only needed to cast from legacy node private key types,
|
||||
|
||||
Reference in New Issue
Block a user