Sign Object (QYDOSGNO, QydoSignObject) API


  Required Parameter Group:


  Service Program Name: QYDOSGN1

  Default Public Authority: *USE

  Threadsafe: No

The Sign Object (OPM, QYDOSGNO; ILE, QydoSignObject) API allows the local system to certify that the object being signed is trustworthy as of the time the object is being signed.

The application identifier will be used to find the certificate needed to sign this object. The certificate will be used later to verify the contents of this object have not changed and this certificate will be reported as having signed this object.


Authorities and Locks

Authority Required
For objects in a library:
  • *OBJOPR and *OBJMGT authority to the object
  • *OBJOPR and *EXECUTE authority to the library.
For objects in a directory:
  • *R and *OBJMGT authority to the object
  • *X authority to each directory in the path
    *R for the directory with wildcards (that is, a pattern is specified)
    *RX authority to each subdirectory searched if the subdirectories parameter specifies 1.

To use this API, you must be authorized to the object signing applications function associated with your application identifier through System i™ Navigator's Application Administration support. The Change Function Usage Information (QSYCHFUI) API, with a function ID of the same name as the application identifier, also can be used to change the list of users that are allowed to use this application identifier.

See the open()--Open File API for the authority needed to the results path name. The file is open for append and is created if it does not already exist.

Locks
Object will be locked exclusive no read.

Required Parameter Group

Object path name
INPUT; CHAR(*)

The path name of the object you want to sign. If the object is not in a library, the name may be relative to the current directory or may specify the entire path name. If the object is in a library the name must be in the form '/QSYS.LIB/libname.LIB/objname.objtype' if you are using format OBJN0100 object path naming. For example to sign a program named NEWEMPL in library PAYROLL, the qualified object name would be '/QSYS.LIB/PAYROLL.LIB/NEWEMPL.PGM' if you are using format OBJN0100 object path naming. Also if you are using format OBJN0100 object path naming, this parameter is assumed to be represented in the coded character set identifier (CCSID) currently in effect for the job. If the CCSID of the job is 65535, this parameter is assumed to be represented in the default CCSID of the job.

The path name may contain wildcard characters. '*' represents any number of unknown characters. '?' represents any single unknown character. For example, to specify all the program objects in library MYLIB, using format OBJN0100, you could specify '/QSYS.LIB/MYLIB.LIB/*.PGM'. If you want to sign all signable objects in a library or directory, specify the last part of the path name as simply '*'. For example to sign all signable objects in MYLIB, assuming you are using format OBJN0100, you could specify '/QSYS.LIB/MYLIB.LIB/*'.

If the object is in the QSYS file system, it must an object type *PGM, *SRVPGM, *MODULE, *SQLPKG, *FILE (save file), or *CMD.

Length of object path name
INPUT; BINARY(4)

The length of the object path name. If the format of object path name is OBJN0200, this field must include the QLG path name structure in addition to the path name itself. If the format of object path name is OBJN0100, only the path name itself is included.

Format of object path name
INPUT; CHAR(8)

The format of the object path name parameter.


Application identifier
INPUT; CHAR(*)

The user-supplied application ID to sign objects with. The application type must be 4 (object signing) and it must be assigned to a valid certificate label. User-supplied application IDs should not preface their application ID with QIBM. User-supplied application IDs should start with the company name to eliminate most problems that involve unique names. Application IDs should use an underscore (_) to separate parts of the name (for example, QIBM_OS400_HOSTSERVER). Also, IDs for related applications should start with the same name (for example, QIBM_DIRSRV_SERVER and QIBM_DIRSRV_REPLICATION).

The following characters are allowed in an application ID. The first character of the application ID must be one of the following:

The remaining characters in the application ID must be made up of the following characters:


Length of application identifier
INPUT; BINARY(4)

The length of the specified application identifier. This length must be a value from 1 to 30.

Replace duplicate signature
INPUT; CHAR(1)

Whether the old signature is left or replaced if a signature using the same certificate as the application identifier above uses is detected.


If the object contents have changed since the first time this certificate signed the object, the signature is replaced automatically. This parameter only affects signatures where the content has not changed.

Multiple objects characteristics
INPUT; CHAR(*)

How multiple objects specified on the object path name parameter are handled. See Multiple objects characteristics format for details on the format of this parameter. This field may be NULL if the length of multiple objects characteristics is 0.

Length of multiple objects characteristics
INPUT; BINARY(4)

The length of the specified multiple objects characteristics. This length may be 0 if you want to use the default values for all these characteristics or 1 or greater to indicate how many bytes of the characteristics should be used.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Multiple objects characteristics format

The format of the multiple objects characteristics is shown in the following table. For detailed descriptions of the fields in the tables, see Field Descriptions.



Field Descriptions

Format of content of the results file. The format of the content of the file containing the results of this call.

Format of results path name. The format of the results path name parameter.

Length of results path name. The length of the results path name. 0 length means no results files are used, and the results path name and format of results path name parameter values are not used. If the format of results path name is OBJN0200, this field must include the QLG path name structure in addition to the path name itself. If the format of results path name is OBJN0100, only the path name itself is included.

Offset to results path name. Offset from the beginning of this structure to the results path name.

Reserved. This field currently is not used. It is filled with binary zeroes.

Results path name. The path name of the object you want to contain the results on this call. This object may not be in a library (that is, it may not be under the /QSYS.LIB directory). The name may be relative to the current directory or may specify the entire path name. For example, to store results in a file called SIGNED.LST in the MYDIR directory, the results path name would be '/MYDIR/SIGNED.LST'. If you are using format OBJN0100, this parameter is assumed to be represented in the coded character set identifier (CCSID) currently in effect for the job. If the CCSID of the job is 65535, this parameter is assumed to be represented in the default CCSID of the job.

If this is an existing file, results are appended to the end of the file. Otherwise, a new file is created.

The default is not to have a results file.

Sign only core part of object. Whether the entire object be signed or not. This value only applies to objects that can have the core part of the object signed. Objects which cannot have only a core part of the object signed will sign the entire object, independent of the value specified here.

Currently, only *CMD objects can have a core part of the object signed.

A value of hex 00 will be treated as the default value for this field. This can happen when a program written in V5R1 (where this field was not defined) is run on V5R2.

Stop on first error. Whether control should be returned on the first error found.

Subdirectories. Whether objects in directories under the directory specified in the object path name parameter should be processed also.



RSLT0100 format

The following table describes the order and format of the data returned in the RSLT0100 format. This data is repeated for each object that was attempted to be processed. For detailed descriptions of the fields in the tables, see Field Descriptions.

Note:All data in this file will be in CCSID 13488. New files will be created in this CCSID. If an existing file is named that has a different CCSID, an error will be reported.



Field Descriptions

Date. The date the operation took place. The format will be YYYYMMDD. For example, June 30, 2002 will be 20020630.

Fully qualified object name. The simple path name from the root to the object being signed. The field will be terminated with a new line character.

Message identifier. The error message used to report failure. This field is blank if no error was detected for this object.

Operation type. The operation that was attempted.

Operation type description. Short word description of the operation that was attempted.

Reserved. This field currently is not used. It is filled with blanks.


Error Messages



API introduced: V5R1

[ Back to top | Security APIs | APIs by category ]