Change Password
This workflow can take place when the end user wants/needs to change their password as part of the standard application usage.
Password change can be mandated at regular intervals if the password policy specifies a maxAge
value for instance.
If the password policy specifies a minAge
greater than 0, then the password must be changed at the end of the provisioning workflow, and before being able to use the key protected by this password.
Perform the usual steps to get the Container instance.
- Create an instance of the Device (
DeviceFactory.getDevice
). - Get the instance of the Container (
Device.findContainers
). - At this point, depending on the server configuration, either:
- Get the container policy (
Container.getProtectionPolicy
). - Find the key whose password needs to be changed (
Container.findKeys
) and its protection policy (Key.getProtectionPolicy
). - Prompt the end user for the old and new passwords, and change it (
PasswordPolicy.changePassword
). - If the current password is correct and the new password matches the Protection Policy, then the operation is successful and the password is changed. Otherwise, an error is returned/thrown.
Or