NPKIT_x509SubjectAltName

Retrieves the specified subject alternative name and related information (formerly NW509SubjectAltName).

Syntax

   #include "NPKIT_x509.h"
   
   NWRCODE NPKIT_x509SubjectAltName
   (
      NPKIT_x509Context      context,
      nuint32                index,
      nuint8                *type,
      nuint8 const         **value,
      pnuint32               length,
      unicode const        **name
   );
   

Parameters

context
(IN) Specifies the NPKIT_x509 context handle for the request. This is a nuint32 value.
index
(IN) Specifies which subject alternative name is to be returned. index is 0 based.
type
(OUT) Points to the type of subject alternative name. For more information, see the section Section 4.3, General Name Type Extensions.
value
(OUT) Points to the ASN.1 encoded subject alternative name.
length
(OUT) Specifies the length of value.
name
(OUT) Points to a Unicode string containing a representation of the subject alternative name.

NOTE:This field is only set when the Subject Alternative Name is one of the following types:

  • X509_GENERAL_NAME_RFC822_NAME
  • X509_GENERAL_NAME_DNS_NAME
  • X509_GENERAL_NAME_DIRECTORY_NAME

For more details, see Section 4.3, General Name Type Extensions.

Return Values

Returns 0 if successful or a PKI error code if not successful. For a listing of NPKIT error codes, see Certificate Server Error Code Constants.

Remarks

Before calling this function, you must first successfully call NPKIT_x509DecodeCertificate. You should call NPKIT_x509SubjectAltNamesInfo before calling this function to determine how many subject alternative names are encoded in the certificate. For more details about subject alternative names, see Section 4.3, General Name Type Extensions. The subject alternative name extension is optional. Therefore, not all certificates have subject alternative names.

See Also

NPKIT_x509DecodeCertificate, NPKIT_x509GetExtensionData, NPKIT_x509IssuerAltName, NPKIT_x509SubjectAltNamesInfo