SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration

#include <SharkSSL.h>

Data Fields

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

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)
{
&se, ci->subjectAltNamesPtr, ci->subjectAltNamesLen);
xprintf((" subject's alternate DNS names/IP addresses:\n"));
{
U16 l = SubjectAltName_getLen(&s);
U8 *tp = SubjectAltName_getPtr(&s);
{
xprintf((" IP address: "));
while (l--)
{
xprintf(("%d", *tp++));
if (l)
{
xprintf(("."));
}
}
xprintf(("\n"));
}
{
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 SUBJECTALTNAME_DNSNAME
Definition: SharkSslEx.h:81
#define SubjectAltName_getLen(o)
Definition: SharkSslEx.h:68
#define SubjectAltName_getTag(o)
Definition: SharkSslEx.h:67
#define SUBJECTALTNAME_IPADDRESS
Definition: SharkSslEx.h:86
#define SubjectAltNameEnumerator_nextElement
Definition: SharkSslEx.h:74
#define SubjectAltName_getPtr(o)
Definition: SharkSslEx.h:69
SHARKSSL_API void SubjectAltNameEnumerator_constructor(SubjectAltNameEnumerator *o, U8 *ptr, SharkSslSANLen len)
SHARKSSL_API void SubjectAltNameEnumerator_getElement(SubjectAltNameEnumerator *o, SubjectAltName *s)
#define SubjectAltName_isValid(o)
Definition: SharkSslEx.h:70
#define xprintf(data)
The macro xprintf expands to function _xprintf if the code is compiled with XPRINTF set to 1.
Definition: selib.h:299
Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions.
Definition: SharkSSL.h:739
U8 provinceLen
length in bytes of the field "country"
Definition: SharkSSL.h:752
const U8 * province
State or Province.
Definition: SharkSSL.h:741
U8 localityLen
length in bytes of the field "province"
Definition: SharkSSL.h:753
const U8 * organization
Organization Name (company or department)
Definition: SharkSSL.h:743
const U8 * commonName
Common Name is the Host + Domain Name (example: www.mycompany.com, where www is host and mycompany....
Definition: SharkSSL.h:748
const U8 * countryName
ISO3166 country code.
Definition: SharkSSL.h:740
U8 organizationLen
length in bytes of the field "locality"
Definition: SharkSSL.h:754
U8 commonNameLen
length in bytes of the field "unit"
Definition: SharkSSL.h:756
const U8 * locality
The city or town name.
Definition: SharkSSL.h:742
U8 countryNameLen
Definition: SharkSSL.h:751
SubjectAltName Iterator.
Definition: SharkSslEx.h:52
SubjectAltName.
Definition: SharkSslEx.h:61
See also
SharkSslCertInfo

Field Documentation

◆ commonName

const U8* SharkSslCertDN::commonName

Common Name is the Host + Domain Name (example: www.mycompany.com, where www is host and mycompany.com is Domain Name)

◆ commonNameLen

U8 SharkSslCertDN::commonNameLen

length in bytes of the field "unit"

◆ countryName

const U8* SharkSslCertDN::countryName

ISO3166 country code.

◆ countryNameLen

U8 SharkSslCertDN::countryNameLen

◆ emailAddress

const U8* SharkSslCertDN::emailAddress

◆ emailAddressLen

U8 SharkSslCertDN::emailAddressLen

length in bytes of the field "common name"

◆ locality

const U8* SharkSslCertDN::locality

The city or town name.

◆ localityLen

U8 SharkSslCertDN::localityLen

length in bytes of the field "province"

◆ organization

const U8* SharkSslCertDN::organization

Organization Name (company or department)

◆ organizationLen

U8 SharkSslCertDN::organizationLen

length in bytes of the field "locality"

◆ province

const U8* SharkSslCertDN::province

State or Province.

◆ provinceLen

U8 SharkSslCertDN::provinceLen

length in bytes of the field "country"

◆ unit

const U8* SharkSslCertDN::unit

Organizational Unit (OU: department or organization unit)

◆ unitLen

U8 SharkSslCertDN::unitLen

length in bytes of the field "organization"