Examples

Example 1

Example 1

This example changes the password to the important_key encryption key. If the key owner executes this command, it reencrypts the base key; if the user assigned a key copy executes this command, it reencrypts that key copy.

alter encryption key important_key with passwd 'oldpassword'
modify encryption with passwd 'newpassword'

Example 2

Example 2

Changes the password on a key copy to the current session’s login password. This command can be executed only by a user who has been assigned a key copy:

alter encryption key important_key
     modify encryption
     with passwd login_passwd

Example 3

Example 3

Changes the password for the important_key encryption key to the system password. This command can be executed only by the key owner or a user with sso_role, and is allowed only if a key has no key copies. It modifies the encryption of the base key:

alter encryption key important_key
with passwd 'ReallyBigSecret'
modify encryption with passwd system_encr_passwd

Example 4

Example 4

Changes the password for the important_key encryption key from the system encryption password to a new password (because the system encryption password is the default password, it does not need to be specified in the statement):

alter encryption key important_key
     modify encryption
     with passwd 'ReallyNewPassword'

Example 6

Example 5

Adds encryption for user “ted” for the important_key encryption key with the password just4now:

alter encryption key important_key
     with passwd 'TopSecret' 
     add encryption with passwd 'just4now'
     for user 'ted'

Example 7

Example 6

Modifies the encryption for user “ted” to use a new password. Only “ted” can execute this command:

alter encryption key important_key
     with passwd 'just4now'
     modify encryption
     with passwd 'TedsOwnPassword'

Example 8

Example 7

Drops encryption for user “ted” for the important_key encryption key:

alter encryption key important_key
     drop encryption for user 'ted'

Example 9

Modifies the owner of important_key to new owner, “tinnap:”

alter encryption key important_key modify owner tinnap