Documentation
¶
Index ¶
Constants ¶
const KeyJSONSchema = `` /* 839-byte string literal not displayed */
KeyJSONSchema should be used to validate keys in JSON form
const VerifierJSONSchema = `` /* 1070-byte string literal not displayed */
VerifierJSONSchema should be used to validate verifiers in JSON form
Variables ¶
This section is empty.
Functions ¶
func IsVerifierValid ¶
IsVerifierValid ensures the verifier's checksum matches
func NewRandomBytes ¶
NewRandomBytes generates a byte array full of cryptographic strength random data
func UUIDEquals ¶
UUIDEquals returns true if the two UUID contents are equal. False otherwise.
Types ¶
type Key ¶
type Key struct {
Group uuid.UUID `json:"group"`
Secret []byte `json:"secret"`
Checksum []byte `json:"checksum"`
}
Key is a value that administrators will configure the Weaklayer Sensor with. Its purpose is to authenticate the sensor to the gateway so we know it is allowed to send data.
type Verifier ¶
type Verifier struct {
Group uuid.UUID `json:"group"`
Salt []byte `json:"salt"`
Hash []byte `json:"hash"`
Checksum []byte `json:"checksum"`
}
Verifier is data provided to the Weaklayer Gateway so it can verify the key that a Weaklayer Sensor Provides.
func NewVerifier ¶
NewVerifier creates a new install verifier from an existing key and a random salt On error, the default Verifier is returned with error set