# UserCryptoManager.getLatestUserKey(Object object)
Start from base library version 2.17.3. Please remaining backward compatible.
with Promise style call: Not supported
Mini Program plugin: Not supported
Get the latest user encryption key
# parameter
# Object object
| attribute | type | Default values | Required | Introductions |
|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | |
| fail | function | no | Interface calls failed callback functions | |
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
# object.success callback
# parameter
# Object object
| attribute | type | Introductions |
|---|---|---|
| encryptKey | string | User encryption key |
| iv | string | Initial key vector |
| version | number | Key version |
| expireTime | number | Key Expiration Time |
# sample code
const userCryptoManager = wx.getUserCryptoManager()
userCryptoManager.getLatestUserKey({
success: res => {
const {encryptKey, iv, version, expireTime} = res
console.log(encryptKey, iv, version, expireTime)
}
})