Encrypt Object (ENCSAVOBJ)
The ENCSAVOBJ command allows authorized users to encrypt and save a copy of one or more objects to a device (physical or virtual) or to the IFS. Encryption algorithms provided are AES128, AES192 and AES256. Either a Symmetric Key or a Password can be specified for the encryption.
The system will save the specified objects by writing a copy of each object. The objects are not affected in the system. However, the description of each object is changed with the date, time, and place when it was last saved, unless *NO is specified on the Update history prompt (UPDHST parameter).
For job queues, message queues, output queues, and logical files, only the object definitions are saved, not the contents. Logical file access paths may be saved, however, by using the ACCPTH parameter.
Make sure the QSYSWRK subsystem is active for support of the ENCSAVOBJ command.
Monitoring for Errors
When executing the ENCSAVOBJ command within a CL program, you can trap for errors by monitoring for message ids. The message ids for the ENCSAVOBJ command are listed below:
CRE0713 - Object(s) were not encrypted. Review JOB LOG.
CRE3701 - &1 objects were saved; &2 objects were not saved.
Auditing
If a Symmetric Key is used for the ENCSAVOBJ command and “Log encryption 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 encryption.
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 3.
Options
Object (OBJ)
Specifies the names of one or more objects or the generic name of each group of objects to be saved. All the objects must be in the library specified on the Library prompt (LIB parameter). If the Object type prompt (OBJTYPE parameter) is not specified, all the object types listed in the description of that parameter are saved, provided they are in the specified library and have the specified names.
This is a required parameter.
The possible values are:
Library (LIB)
Specifies the name of the library that contains the objects.
This is a required parameter.
The possible values are:
Object type (OBJTYPE)
Specifies the type of system objects to save. For a complete list of object types that can be saved, 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 save operation. The device name must already be known on the system by a device description.
This is a required parameter.
The possible values are:
Specify whether or not to save changed objects.
The possible values are:
Journaled objects (OBJJRN)
Specifies whether to save changed objects that are currently being journaled and that have been journaled since the date and time specified on the REFDATE and REFTIME parameters.
The possible values are:
Reference date (REFDATE)
Specifies the reference date. Objects that have been changed since this date are saved.
The possible values are:
Reference time (REFTIME)
Specifies the reference time. Objects that have been changed since this time on the specified date are saved.
The possible values are:
Volume identifier(VOL)
Specifies the volume identifier on which the data is saved.
The possible values are:
Sequence number (SEQNBR)
Specifies, when tape is used, the sequence number to use as the starting point for the save operation.
The possible values are:
Label (LABEL)
Specifies the name that identifies the data file on the tape or diskette that is to be used for the save operation.
The possible values are:
File expiration date (EXPDATE)
Specifies the expiration date of the file created by the save operation. If a date is specified, the file is protected and cannot be overwritten until the specified expiration date. The expiration date must be later than or equal to the current date.
The possible values are:
End of media option (ENDOPT)
Specifies the operation that is automatically done on the tape or optical volume after the save operation ends.
The possible values are:
Target release (TGTRLS)
Specifies the release of the operating system on which you intend to restore and use the object.
When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V2R3M0 is version 2, release 3 modification level 0.
To specify that an object be saved for distribution to a system at a different release level than the system on which the save operation is to occur, the procedure differs for program or non-program objects and by the release level on which a program object is created. If, for example, you are saving an object for distribution to a target system running on an earlier release, you have the following choices:
For program objects
- If the program object was created at a release level more current than the targeted earlier release, you must (1) create the program object again specifying the targeted earlier release, (2) save the program object specifying the targeted earlier release, and then (3) restore the program object on the target system.
- If the program object was created at the same release level as the target system, you can (1) save the program object specifying the targeted earlier release and then (2) restore the program object on the target system.
For non-program objects
- You can (1) save the object specifying the targeted earlier release and then (2) restore the object on the target system.
The possible values are:
Update history (UPDHST)
Specifies whether the save history information of each saved object is changed with the date, time, and location of this save operation. The save history information for an object is displayed using the Display Object Description (DSPOBJD) command. The save history information is used to determine which journal entries are processed when RCVRNG(*LASTSAVE) and FROMENT(*LASTSAVE) are used on the Apply Journaled Changes (APYJRNCHG) command.
The possible values are:
Object pre-check (PRECHK)
Specifies whether the save operation for a library ends if any of the following are true:
- The objects do not exist
- The library or the objects were previously found to be damaged
- The library or the objects are locked by another job
- The requester of the save operation does not have authority to the library or to save the objects.
The possible values are:
Save active (SAVACT)
Specifies whether an object can be updated while it is being saved.
The possible values are:
Save active wait time (SAVACTWAIT)
Specifies the amount of time to wait for a commit boundary or an object that is in use before continuing the save. If an object remains in use for the specified time, the object is not saved. If a commit boundary is not reached in the specified time, the save operation is ended.
The possible values are:
Save active message queue (SAVACTMSGQ)
Specifies the message queue that the save operation uses to notify the user that the checkpoint processing for a library is complete. A separate message is sent for each library to be saved when the *SYSDFN or *LIB value is specified on the Save active prompt (SAVACT parameter)
The possible values are:
The possible library values are:
Save access paths (ACCPTH)
Specifies whether the logical file access paths that are dependent on the physical files being saved are also saved.
The access paths are saved only in the case of the following:
- All members on which the access paths are built are included in this save operation.
- The access paths are not invalid or damaged at the time of thesave.
However, if the logical files and the based-on physical files are in different libraries and the logical files or physical files do not exist at restore time (such as during disaster recovery or the files were deleted) the access paths are not restored. They are rebuilt.
For the fastest possible restore operation for logical files, the logical files and the based-on physical files must be in the same library and must be saved at the same time.
The possible values are:
ASP device (ASPDEV)
Specifies the name of the auxiliary storage pool (ASP) device to be included in the save operation.
The possible values are:
Algorithm (ALGORITHM)
Indicate which algorithm to use to encrypt the data.
The default is *AES256
The possible values are:
Compress data (COMPRESS)
Specifies whether to compress the data during the backup. The compression option may increase the save times. This command uses the TERSE compression algorithm.
The possible values are:
Use key or password (USEKEYPAS)
Indicate to use either a key from a key store or a password to encrypt the data.
The default is *KEY
The possible values are:
Key label (KEYLABEL)
Indicate the label of the key to use for encrypting the data.
Key store name (KEYSTR)
Indicate the object name and library of the Key Store which contains the Symmetric Key to use for encryption of the data.
The possible values are:
The possible library values are:
Store key information (STRKEYINF)
Indicate whether to store the key label and key store library/name in the encrypted data. This is useful in that you will not have to remember which key label to use on the decryption process.
The default is *YES
The possible values are:
Password (PASSWORD) - Help
Specify the password to encrypt the data.
The possible values are:
Encrypted file directory (ENCFDIR) - Help
Specifies the IFS directory to store the encrypted Stream file.
The possible values are:
Encrypted file name (ENCFNAM) - Help
Specifies the name of the encrypted Stream file to create.
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:
Output information (OUTPUT)
Specifies whether a list with information about the saved objects is created. The information can be printed with the job's spooled output or directed to a database file.
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:
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:
Type choices, press Enter. Objects . . . . . . . . . . . . > EMP* Name, generic*, *ALL + for more values > PAY* Library . . . . . . . . . . . . > PAYROLL Name Object type . . . . . . . . . . > *FILE *ALL, *ALRTBL, *BNDDIR... Device . . . . . . . . . . . . . > TAP01 Name, *IFS Save changed objects only . . . > *NO *NO, *YES Volume identifier . . . . . . . *MOUNTED Sequence number . . . . . . . . *END 1-16777215, *END Label . . . . . . . . . . . . . *LIB File expiration date . . . . . . *PERM Date, *PERM End of media option . . . . . . *REWIND *REWIND, *LEAVE, *UNLOAD Target release . . . . . . . . . *CURRENT *CURRENT, *PRV, VxRxMx Update history . . . . . . . . . *YES *NO, *YES Object pre-check . . . . . . . . *NO *NO, *YES Save active . . . . . . . . . . *NO Name, *NO, *LIB, *SYSDFN Save active wait time . . . . . 120 0-99999, *NOMAX Save active message queue . . . *NONE Name, *NONE, *WRKSTN Library . . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB Save access paths . . . . . . . *NO *NO, *YES ASP device . . . . . . . . . . . * Name, *, *SYSBAS, *CURASPGRP Algorithm . . . . . . . . . . . *AES256 *AES256, *AES192, *AES128 Use key or password . . . . . . *KEY *KEY, *PASS Key label . . . . . . . . . . . BACKUPKEY Key store name . . . . . . . . . *DEFAULT Name, *DEFAULT Library . . . . . . . . . . . *LIBL Name, *LIBL Store key label . . . . . . . . *YES *NO, *YES |
Screen Example: ENCSAVOBJ Command with Sample Values