SharkSSL™ Embedded SSL/TLS Stack

Detailed Description

Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions.

Certificate Distinguished Name

Example from certcheck.c:

xprintf(("-------- Begin Cert Info -----------\n"));
while (ci)
{
SharkSslCertDN *dn = &(ci->subject);
xprintf(("certificate content:\r\n"));
xprintf(("Subject:\n"));
printCertField(dn->countryName, dn->countryNameLen);
printCertField(dn->province, dn->provinceLen);
printCertField(dn->locality, dn->localityLen);
printCertField(dn->organization, dn->organizationLen);
printCertField(dn->commonName, dn->commonNameLen);
if (ci->subjectAltNamesLen)
{
SubjectAltNameEnumerator_constructor(
&se, ci->subjectAltNamesPtr, ci->subjectAltNamesLen);
xprintf((" subject's alternate DNS names/IP addresses:\n"));
for (SubjectAltNameEnumerator_getElement(&se, &s);
SubjectAltName_isValid(&s);
SubjectAltNameEnumerator_nextElement(&se, &s))
{
U16 l = SubjectAltName_getLen(&s);
U8 *tp = SubjectAltName_getPtr(&s);
if (SUBJECTALTNAME_IPADDRESS == SubjectAltName_getTag(&s))
{
xprintf((" IP address: "));
while (l--)
{
xprintf(("%d", *tp++));
if (l)
{
xprintf(("."));
}
}
xprintf(("\n"));
}
else if (SUBJECTALTNAME_DNSNAME == SubjectAltName_getTag(&s))
{
xprintf((" DNS name: "));
while (l--)
{
xprintf(("%c", *tp++));
}
xprintf(("\n"));
}
}
xprintf(("\n"));
}
dn = &(ci->issuer);
xprintf(("Issuer:\n"));
printCertField(dn->countryName, dn->countryNameLen);
printCertField(dn->province, dn->provinceLen);
printCertField(dn->locality, dn->localityLen);
printCertField(dn->organization, dn->organizationLen);
printCertField(dn->commonName, dn->commonNameLen);
if (ci->parent)
{
xprintf(("\nparent's "));
ci = ci->parent;
}
else
break;
}
xprintf(("--------- End Cert Info ------------\n"));
#define xprintf(data)
The macro xprintf expands to function _xprintf if the code is compiled with XPRINTF set to 1.
Definition: selib.h:261
Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions.
Definition: SharkSSL.h:776
U8 provinceLen
length in bytes of the field "country"
Definition: SharkSSL.h:789
const U8 * province
State or Province.
Definition: SharkSSL.h:778
U8 localityLen
length in bytes of the field "province"
Definition: SharkSSL.h:790
const U8 * organization
Organization Name (company or department)
Definition: SharkSSL.h:780
const U8 * commonName
Common Name is the Host + Domain Name (example: www.mycompany.com, where www is host and mycompany....
Definition: SharkSSL.h:785
const U8 * countryName
ISO3166 country code.
Definition: SharkSSL.h:777
U8 organizationLen
length in bytes of the field "locality"
Definition: SharkSSL.h:791
U8 commonNameLen
length in bytes of the field "unit"
Definition: SharkSSL.h:793
const U8 * locality
The city or town name.
Definition: SharkSSL.h:779
SubjectAltName Iterator.
Definition: SharkSslEx.h:52
SubjectAltName.
Definition: SharkSslEx.h:61
See also
SharkSslCertInfo

#include <SharkSSL.h>

Data Fields

const U8 * countryName
 ISO3166 country code.
 
const U8 * province
 State or Province.
 
const U8 * locality
 The city or town name.
 
const U8 * organization
 Organization Name (company or department)
 
const U8 * unit
 Organizational Unit (OU: department or organization unit)
 
const U8 * commonName
 Common Name is the Host + Domain Name (example: www.mycompany.com, where www is host and mycompany.com is Domain Name)
 
U8 provinceLen
 length in bytes of the field "country"
 
U8 localityLen
 length in bytes of the field "province"
 
U8 organizationLen
 length in bytes of the field "locality"
 
U8 unitLen
 length in bytes of the field "organization"
 
U8 commonNameLen
 length in bytes of the field "unit"
 
U8 emailAddressLen
 length in bytes of the field "common name"