mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 03:31:39 +00:00
types/key: add ControlPrivate.Shared wrapper too
Follow-up to cfdb8626738da. Change-Id: Iab610d761f1e6d88e8bcb584d9c02cafe48fc377 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
cfdb862673
commit
9bd3b5b89c
@ -56,6 +56,11 @@ func (k ControlPrivate) SealTo(p MachinePublic, cleartext []byte) (ciphertext []
|
|||||||
return k.mkey.SealTo(p, cleartext)
|
return k.mkey.SealTo(p, cleartext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SharedKey returns the precomputed Nacl box shared key between k and p.
|
||||||
|
func (k ControlPrivate) SharedKey(p MachinePublic) MachinePrecomputedSharedKey {
|
||||||
|
return k.mkey.SharedKey(p)
|
||||||
|
}
|
||||||
|
|
||||||
// OpenFrom opens the NaCl box ciphertext, which must be a value
|
// OpenFrom opens the NaCl box ciphertext, which must be a value
|
||||||
// created by SealTo, and returns the inner cleartext if ciphertext is
|
// created by SealTo, and returns the inner cleartext if ciphertext is
|
||||||
// a valid box from p to k.
|
// a valid box from p to k.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user