Decrypt Object (DECRSTOBJ)
The DECRSTOBJ command allows authorized users to restore and decrypt one or more objects that were encrypted with the ENCSAVOBJ or ENCSAVLIB commands. Objects can be restored from a device (physical or virtual) or the IFS. Either a Symmetric Key or a Password can be specified for the decryption process.
The types of objects that can be restored by this command are listed on the Object types prompt (OBJTYPE parameter).
The DECRSTOBJ command will restore the object descriptions and their contents.
If logical file access paths were saved (i.e. ACCPTH(*YES) was specified when the objects were saved), the access paths are restored if (1) all based-on physical files are also being restored by the same restore command, (2) the logical file is also being restored by the same restore command, or the logical file already exists on the system (the same file exists, not a re-created version), and (3) MAINT(*IMMED or *DLY) is in effect for the logical file if it still exists on the system.
The user profile of the system default owner (QDFTOWN) becomes the default owner of objects restored in the system whose owner is not known to the system.
If an object is being restored over an existing object on the system, the object auditing value of the existing object is kept. If the object is being restored as new to the system, the object auditing value is restored from the media.
If this command is used to restore a program, the copy of that program that is currently in the system must not be running while the program is being restored. If this occurs, the running program will not be restored.
Make sure the QSYSWRK subsystem is active for support of the DECRSTOBJ command.
Monitoring for Errors
When executing the DECRSTOBJ command within a CL program, you can trap for errors by monitoring for message ids. The message ids for the DECRSTOBJ command are listed below:
CRE0715 - Object(s) were not decrypted. Review JOB LOG.
CRE3773 - &1 Object(s) restored. &2 not restored to &3.
Auditing
If a Symmetric Key is used for the DECRSTOBJ command and “Log decryption usage” is enabled for the Symmetric Key, then an audit log entry will be generated in the Powertech Encryption for IBM i journal file each time the Key is used for decryption. Each audit entry will indicate the Label and Key Store of the Symmetric Key which was used, along with the user, date, time, job number and job name.
How to Get There
On the Library/Object/File Encryption Menu, choose option 4.
Options
Object (OBJ)
Specifies the names of one or more objects or the generic name of each group of objects to be restored. If the Object type prompt (OBJTYPE parameter) is not specified, all the object types listed in the description of that parameter are restored, provided they are in the specified library and have the specified names. This is a required parameter.
The possible values are:
Saved library (SAVLIB)
Specifies the name of the library that contained the saved objects. If the Restore to library prompt (RSTLIB parameter) is not specified, this is also the name of the library to which the objects are restored. This is a required parameter.
The possible values are:
Object type (OBJTYPE)
Specifies the type of system objects to restore. For a complete list of object types that can be restored, move the cursor to the field for the Object type prompt (OBJTYPE parameter) and press the F4 key.
The possible values are:
Device (DEV)
Specifies the name of the device used for the restore operation. The device name must already be known on the system by a device description. This is a required parameter.
The possible values are:
Volume identifier(VOL)
Specifies the volume identifier of the media or the cartridge identifier of tapes in a tape media library device, from which the data is being restored. The volume that contains the beginning of the file to be restored should be placed in the device.
The possible values are:
Sequence number (SEQNBR)
Specifies, when tape is used, the sequence number to use as the starting point for the restore operation.
The possible values are:
Label (LABEL)
Specifies the name that identifies the data file on the tape or diskette used for the restore operation. This label must have been specified on the save command.
The possible values are:
End of media option (ENDOPT)
Specifies the operation that is automatically done on the tape or optical volume after the restore operation ends.
The possible values are:
Option (OPTION)
Specifies how to handle restoring each object.
The possible values are:
Data base member option (MBROPT)
Specifies, for database files that exist on the system, which members are restored. If *MATCH is used, the member list in the saved file must match, member for member, the current version on the system. All members are restored for files that do not exist, if the file is restored.
The possible values are:
Allow object differences (ALWOBJDIF)
Specifies whether certain differences encountered during a restore operation are allowed. The differences include:
- Ownership: the owner of the object on the system is different than the owner of the object from the save operation.
- File creation date: the creation date of the database file on the system does not match the creation date of the file that was saved.
- Member creation date: the creation date of the database file member on the system does not match the creation date of the member that was saved.
- Validation value verification: The validation value created at the time an object was created does not match the validation value created during the restore operation of an object on a system with a QSECURITY level of 40 or higher.
- Authorization list linking: the object is being restored to a system different from the one on which it was saved.
NOTE: To use this parameter, you need *ALLOBJ special authority.
The possible values are:
- If object differences are found, the final message for the restore operation is an escape message rather than the normal completion message.
- If the media and system owner of the object do not match, the system owner becomes the owner of the object.
- If there is a file level mismatch and *ALL is specified on this parameter and the Data base member option prompt (MBROPT parameter), the existing version of the file is renamed and the saved version of the file is restored. If there is a member level mismatch, the existing version of the member is renamed and the saved version of the member is restored.
- If the system security level is 40, you are restoring a program, you specify *ALL, and the program's validation value is missing or incorrect, the program is restored without authority changes. For programs without a validation value, specifying *ALL also prevents the system from attempting to translate the program again.
- If you are restoring objects to a system different from the one on which they were saved and the objects are secured by an authorization list, specifying *ALL automatically links the objects to the authorization list again. If the authorization list does not exist on the new system, a message that includes the name of the missing list is issued and the public authority is set to *EXCLUDE.
Restore to library (RSTLIB)
Specifies whether the object contents are restored to the same library in which they were saved, or to a different library.
The possible values are:
Restore to ASP device (RSTASPDEV)
Specifies the name of the auxiliary storage pool (ASP) device to which the data is restored.
The possible values are:
Restore to ASP number (RSTASP)
Specifies whether objects are restored to the auxiliary storage pool (ASP) from which they were saved or to the system ASP (ASP number 1) or to a basic user ASP (ASP numbers 2 through 32).
Some objects cannot be restored to user ASPs. More information about object types which can be restored to user ASPs is in the Backup and Recovery book, SC41-5304. If the library exists in, or is being restored to the system ASP, journals, journal receivers, and save files can be restored to basic user ASPs. All other object types will be restored to the ASP of the library.
The possible values are:
Use key or password (USEKEYPAS)
Indicate to use either a key from a key store or a password to decrypt the data. The default is *KEY.
The possible values are:
Key label (KEYLABEL)
Indicate the label of the key to use for decrypting the data.
The possible values are:
Key store name (KEYSTR)
Indicate the object name and library of the Key Store which contains the Symmetric Key to use for decryption of the data.
The possible values are:
The possible library values are:
Password (PASSWORD) - Help
Specify the password to decrypt the data.
The possible values are:
Encrypted file name (ENCFNAM) - Help
Specifies the name of the encrypted Stream file that was used when the ENCSAVOBJ command was issued.
The possible values are:
Restore file directory (RSTFDIR) - Help
This is the directory in which the encrypted Stream file is located.
The possible values are:
Remove encrypted file after (RMVENCF) - Help
Specifies if the encrypted Stream file should be removed after it is decrypted into the staging Save file.
The possible values are:
Objects to omit (OMITOBJ) - Help
Specifies the objects to be excluded from the operation. Up to 25 objects or generic object values can be specified. Specify the object name(s), library(s) and type(s) to be omitted.
The possible values are:
The possible library values are:
The possible type values are:
The possible values are:
File to receive output (OUTFILE) - Help
Specifies the database file to which the information is directed when *OUTFILE is specified for the Output (OUTPUT) parameter. If the file does not exist, this command creates a database file in the specified library. If a new file is created, the system uses QASAVOBJ in QSYS with the format name QSRSAV as a model.
The possible values are:
The possible library values are:
Specify the name of the library to be searched.
Output member options (OUTMBR) - Help
Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.
Member to receive output
The possible values are:
Output option (OUTOPT) - Help
Specifies the output option for the file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.
The possible values are:
Type of output information (INFTYPE) - Help
Specifies the type of information which is printed or directed to the database file.
The possible values are: