Skip to main content

rotate_cipher_password

Function rotate_cipher_password 

Source
pub fn rotate_cipher_password(
    key_store: &KeyStore<KeySlotIds>,
    organization_id: OrganizationId,
    cipher: Cipher,
    new_password: &str,
) -> Result<CipherRequestModel, RotationCipherError>
Expand description

Builds the cipher write that rotates cipher’s password to new_password.

Rejects ciphers from another organization, non-logins, restricted ciphers (re-encrypting would wipe the withheld fields) and ciphers without an item key. Decryption is strict, so a field that fails to decrypt is an error rather than wiped. The request sends back the item key as fetched, since the server requires it unchanged.