Documentation
¶
Overview ¶
Package deviceauth authenticates the optional device transport envelope. A shared transport key does not attest a physical device or an official app.
Index ¶
Constants ¶
View Source
const ( MaxAge = 5 * time.Minute FutureSkew = 30 * time.Second )
Variables ¶
View Source
var ErrInvalidEnvelope = errors.New("invalid device envelope")
Functions ¶
func Decrypt ¶
Decrypt reverses Encrypt: cipherText is the base64 ciphertext and ivStr the nonce Encrypt returned with it.
func Encrypt ¶
Encrypt encrypts plainText for the device transport with AES-256-CBC and PKCS#7 padding. It returns the base64 ciphertext and the nonce, the current time in hexadecimal nanoseconds. The IV is derived from the nonce and the key instead of being sent, so the receiver needs the nonce to decrypt; the envelope carries it as its time.
Types ¶
Click to show internal directories.
Click to hide internal directories.