Encrypt Library (ENCSAVLIB)
The ENCSAVLIB command allows authorized users to encrypt and save a copy of one or more libraries 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 process.
The ENCSAVLIB command saves the entire library, including the library description, the object descriptions and the contents of the objects in the library. The libraries and their objects are not affected in the system.
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 ENCSAVLIB command.
Monitoring for Errors
When executing the ENCSAVLIB command within a CL program, you can trap for errors by monitoring for message ids. The failure message ids for the ENCSAVLIB command are listed below:
CRE0712 - Library(s) were not encrypted. Review JOB LOG.
CRE3701 - &1 objects were saved; &2 objects were not saved.
CRE3751 - Some Libraries not saved.
Auditing
If a Symmetric Key is used for the ENCSAVLIB 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 that 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 1.
Options
Library (LIB)
Specifies which libraries are saved.
Device (DEV)
This is a required parameter.
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 the save.
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(s).
An encrypted Stream file will be created in this IFS directory for each library saved. The name of each Stream file will correspond with the name of the library saved into it.
The file extension of .AES will be appended.
For instance, the library named OEDATA would be encrypted into a Stream file named OEDATA.AES.
The possible values are:
Libraries to omit (OMITLIB) - Help
Specifies the names of one of more libraries, or the generic names of each group of libraries, to be excluded from the save operation.
Up to 25 library(s) or generic names can be entered.
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:
Encrypt Library (ENCSAVLIB) Type choices, press Enter. Library . . . . . . . . . . . . > PAYROLL Name, generic*, *ALL + for more values > GLDATA Device . . . . . . . . . . . . . > TAP01 Name, *IFS 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
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys |
Screen Example: ENCSAVLIB Command with Sample Values