Decrypt a passcode that was encrypted using the Nest Passcode Encryption scheme.
Details
Parameters
[in] encPasscode
A pointer to the encrypted passcode buffer.
[in] encPasscodeLen
The encrypted passcode length.
[in] passcodeBuf
A pointer to a buffer to receive the decrypted passcode.
[in] passcodeBufSize
The size of the buffer pointed at by passcodeBuf.
[out] passcodeLen
Set to the length of the decrypted passcode.
[in] groupKeyStore
A pointer to the group key store object.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_UNSUPPORTED_PASSCODE_CONFIG
If specified passcode configuration is not supported.
WEAVE_ERROR_PASSCODE_AUTHENTICATION_FAILED
If passcode authentication fails.
WEAVE_ERROR_PASSCODE_FINGERPRINT_FAILED
If passcode fingerprint check fail-es.
WEAVE_ERROR_INVALID_KEY_ID
If the requested key has invalid key Id.
WEAVE_ERROR_BUFFER_TOO_SMALL
If the supplied passcode buffer is too small.
WEAVE_ERROR_INVALID_ARGUMENT
If the encrytped passcode is too short or too long; Or if pointer to the group key store is not provided or platform key store returns invalid key parameters.
other
Other platform-specific errors returned by the platform key store APIs.
Decrypt a passcode that was encrypted using the Nest Passcode Encryption scheme.
Details
Parameters
[in] encPasscode
A pointer to the encrypted passcode buffer.
[in] encPasscodeLen
The encrypted passcode length.
[in] encKey
A pointer to the key to be used to encrypt the passcode. The length of the key must match the encryption algorithm associated with the specified configuration.
[in] authKey
A pointer to the key to be used to authenticate the passcode. The length of the key must match the authentication algorithm associated with the specified configuration.
[in] fingerprintKey
A pointer to the key to be used to generate the passcode fingerprint. The length of the key must match the fingerprint algorithm associated with the specified configuration.
[in] passcodeBuf
A pointer to a buffer to receive the decrypted passcode.
[in] passcodeBufSize
The size of the buffer pointed at by passcodeBuf.
[out] passcodeLen
Set to the length of the decrypted passcode.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_UNSUPPORTED_PASSCODE_CONFIG
If specified passcode configuration is not supported.
WEAVE_ERROR_PASSCODE_AUTHENTICATION_FAILED
If passcode authentication fails.
WEAVE_ERROR_PASSCODE_FINGERPRINT_FAILED
If passcode fingerprint check fail-es.
WEAVE_ERROR_BUFFER_TOO_SMALL
If the supplied passcode buffer is too small.
WEAVE_ERROR_INVALID_ARGUMENT
If the encrytped passcode is too short or too long.
Encrypt a passcode using the Nest Passcode Encryption scheme.
Details
Parameters
[in] config
The passcode encryption configuration to be used.
[in] keyId
The requested passcode encryption key Id.
[in] nonce
An unique value assigned to the encrypted passcode.
[in] passcode
A pointer to the passcode to be encrypted.
[in] passcodeLen
The passcode length.
[out] encPasscode
A pointer to the buffer to store encrypted passcode.
[in] encPasscodeBufSize
The size of the buffer for encrypted passcode storage.
[out] encPasscodeLen
The encrypted passcode length.
[in] groupKeyStore
A pointer to the group key store object.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_UNSUPPORTED_PASSCODE_CONFIG
If specified passcode configuration is not supported.
WEAVE_ERROR_BUFFER_TOO_SMALL
If provided output buffer is too small for encrypted passcode.
WEAVE_ERROR_INVALID_KEY_ID
If the requested key has invalid key Id.
WEAVE_ERROR_INVALID_ARGUMENT
If the supplied passcode is too short or too long; Or if pointer to the group key store is not provided or platform key store returns invalid key parameters.
other
Other platform-specific errors returned by the platform key store APIs.
Encrypt a passcode using the Nest Passcode Encryption scheme.
Details
Parameters
[in] config
The Weave passcode encryption configuration to be used.
[in] keyId
The requested passcode encryption key Id.
[in] nonce
An unique value assigned to the passcode.
[in] passcode
A pointer to the passcode to be encrypted.
[in] passcodeLen
The passcode length.
[in] encKey
A pointer to the key to be used to encrypt the passcode. The length of the key must match the encryption algorithm associated with the specified configuration.
[in] authKey
A pointer to the key to be used to authenticate the passcode. The length of the key must match the authentication algorithm associated with the specified configuration.
[in] fingerprintKey
A pointer to the key to be used to generate the passcode fingerprint. The length of the key must match the fingerprint algorithm associated with the specified configuration.
[out] encPasscode
A pointer to a buffer into which the encrypted passcode will be stored. This buffer must be at least kPasscodeMaxEncryptedLen in size.
[in] encPasscodeBufSize
The size of the buffer pointed to by encPasscode.
[out] encPasscodeLen
The encrypted passcode length.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_UNSUPPORTED_PASSCODE_CONFIG
If specified passcode configuration is not supported.
WEAVE_ERROR_BUFFER_TOO_SMALL
If provided output buffer is too small for encrypted passcode.
WEAVE_ERROR_INVALID_ARGUMENT
If the supplied passcode is too short or too long.
Returns true if the supplied passcode encryption configuration is supported by the passcode encryption/decryption APIs.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. The OPENTHREAD and related marks are trademarks of the Thread Group and are used under license.
Last updated 2020-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-08-28 UTC."],[],[]]