z/OS Cryptographic Services System SSL Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


gsk_export_certification_request()

z/OS Cryptographic Services System SSL Programming
SC14-7495-00

Exports a PKCS #10 certification request.

Format

   #include <gskcms.h>

   gsk_status gsk_export_certification_request (  
                                                 gsk_handle                  db_handle,   
                                                 const char *                label,  
                                                 gskdb_export_format         format,   
                                                 gsk_buffer *                stream)

Parameters

db_handle
Specifies the database handle returned by the gsk_create_database() routine or the gsk_open_database() routine. The database must be a request database and not a key database.
label
Specifies the label for the database record. The label is specified in the local code page.
format
Specifies the export format. These values may be specified:
gskdb_export_der_binary
Binary ASN.1 DER-encoded
gskdb_export_der_base64
Base64 ASN.1 DER-encoded
stream
Return the byte stream for the encoded certificatation request. The application should call the gsk_free_buffer() routine to release the storage when it is no longer needed.

Results

The function return value will be 0 if no error is detected. Otherwise, it will be one of the return codes listed in the gskcms.h include file. These are some possible errors:
[CMSERR_BAD_HANDLE]
The database handle is not valid.
[CMSERR_BAD_LABEL]
No database record label is supplied.
[CMSERR_FMT_NOT_SUPPORTED]
An unsupported export file format is specified.
[CMSERR_INCORRECT_DBTYPE]
The database type does not support certification requests.
[CMSERR_NO_MEMORY]
Insufficient storage is available.
[CMSERR_RECORD_NOT_FOUND]
The requested record is not found.

Usage

The gsk_export_certification_request() routine exports a PKCS #10 certification request. The request can be exported using either the ASN.1 DER encoding for the request or the Base64 encoding of the binary value. A Base64 encoded stream will be in the local code page and will include the encoding header and footer lines.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014