SharkSSL™ Embedded SSL/TLS Stack
Peer's certificate information

Detailed Description

Certificate information returned by SharkSslCon_getCertInfo.

Data Structures

struct  SharkSslCertDN
 Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions. More...
 
struct  SharkSslCertInfo
 The peer's certificate information returned by SharkSslCon_getCertInfo. More...
 

Macros

#define SharkSslCertDN_constructor(o)   memset(o,0,sizeof(SharkSslCertDN))
 SharkSslCertDN constructor.
 
#define SharkSslCertDN_setCountryName(o, countryNameMA)    (o)->countryName=(const U8*)countryNameMA,(o)->countryNameLen=(U8)strlen(countryNameMA)
 setCountryName
 
#define SharkSslCertDN_setProvince(o, provinceMA)    (o)->province=(const U8*)provinceMA,(o)->provinceLen=(U8)strlen(provinceMA)
 setProvince
 
#define SharkSslCertDN_setLocality(o, localityMA)    (o)->locality=(const U8*)localityMA,(o)->localityLen=(U8)strlen(localityMA)
 setLocality
 
#define SharkSslCertDN_setOrganization(o, organizationMA)    (o)->organization=(const U8*)organizationMA,(o)->organizationLen=(U8)strlen(organizationMA)
 setOrganization
 
#define SharkSslCertDN_setUnit(o, unitMA)    (o)->unit=(const U8*)unitMA,(o)->unitLen=(U8)strlen(unitMA)
 setUnit
 
#define SharkSslCertDN_setCommonName(o, commonNameMA)    (o)->commonName=(const U8*)commonNameMA,(o)->commonNameLen=(U8)strlen(commonNameMA)
 setCommonName
 
#define SharkSslCertDN_setEmailAddress(o, emailAddressMA)    (o)->emailAddress=(const U8*)emailAddressMA,(o)->emailAddressLen=(U8)strlen(emailAddressMA)
 setEmailAddress
 

Typedefs

typedef struct SharkSslCertDN SharkSslCertDN
 Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions. More...
 
typedef struct SharkSslCertInfo SharkSslCertInfo
 The peer's certificate information returned by SharkSslCon_getCertInfo. More...
 

Typedef Documentation

◆ SharkSslCertDN

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

◆ SharkSslCertInfo

The peer's certificate information returned by SharkSslCon_getCertInfo.

See also
SharkSslCertDN