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


gsk_encode_name()

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

Encodes an X.509 name.

Format

   #include <gskcms.h>

   gsk_status gsk_encode_name ( 
                                x509_name *          name,    
                                gsk_buffer *         stream)

Parameters

name
Specifies X.509 name.
stream
Returns the ASN.1 stream for the name. The application should release the stream when it is no longer needed by calling the gsk_free_buffer() routine.

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:
[ASN_CANT_CONVERT]
A character string contains characters not allowed for the string type.
[ASN_NO_MEMORY]
Insufficient memory is available.

Usage

The gsk_encode_name() routine will encode an X.509 name as an ASN.1 stream. The name will be encoded as described in RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile.

The stringType field in the x509_rdn_attribute structure will be used to determine the format for an encoded directory string. If it is set to x509_string_unknown, the gsk_encode_name() routine attempts to encode the string as an ASN.1 printable string. If the string contains characters not included in the printable string set, the string will be encoded as an ASN.1 UTF-8 string. There are a couple of mandatory exceptions:
  • The countryName attribute is always encoded as a printable string
  • The dnQualifier attribute is always encoded as a printable string
  • The emailAddress attribute is always encoded as an IA5 string
  • The domainComponent attribute is always encoded as an IA5 string

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014