SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
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. More...
 
#define SharkSslCertDN_setCountryName(o, countryNameMA)    (o)->countryName=(const U8*)countryNameMA,(o)->countryNameLen=(U8)strlen(countryNameMA)
 setCountryName More...
 
#define SharkSslCertDN_setProvince(o, provinceMA)    (o)->province=(const U8*)provinceMA,(o)->provinceLen=(U8)strlen(provinceMA)
 setProvince More...
 
#define SharkSslCertDN_setLocality(o, localityMA)    (o)->locality=(const U8*)localityMA,(o)->localityLen=(U8)strlen(localityMA)
 setLocality More...
 
#define SharkSslCertDN_setOrganization(o, organizationMA)    (o)->organization=(const U8*)organizationMA,(o)->organizationLen=(U8)strlen(organizationMA)
 setOrganization More...
 
#define SharkSslCertDN_setUnit(o, unitMA)    (o)->unit=(const U8*)unitMA,(o)->unitLen=(U8)strlen(unitMA)
 setUnit More...
 
#define SharkSslCertDN_setCommonName(o, commonNameMA)    (o)->commonName=(const U8*)commonNameMA,(o)->commonNameLen=(U8)strlen(commonNameMA)
 setCommonName More...
 
#define SharkSslCertDN_setEmailAddress(o, emailAddressMA)    (o)->emailAddress=(const U8*)emailAddressMA,(o)->emailAddressLen=(U8)strlen(emailAddressMA)
 setEmailAddress More...
 

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...
 

Macro Definition Documentation

◆ SharkSslCertDN_constructor

#define SharkSslCertDN_constructor (   o)    memset(o,0,sizeof(SharkSslCertDN))

SharkSslCertDN constructor.

◆ SharkSslCertDN_setCommonName

#define SharkSslCertDN_setCommonName (   o,
  commonNameMA 
)     (o)->commonName=(const U8*)commonNameMA,(o)->commonNameLen=(U8)strlen(commonNameMA)

setCommonName

◆ SharkSslCertDN_setCountryName

#define SharkSslCertDN_setCountryName (   o,
  countryNameMA 
)     (o)->countryName=(const U8*)countryNameMA,(o)->countryNameLen=(U8)strlen(countryNameMA)

setCountryName

◆ SharkSslCertDN_setEmailAddress

#define SharkSslCertDN_setEmailAddress (   o,
  emailAddressMA 
)     (o)->emailAddress=(const U8*)emailAddressMA,(o)->emailAddressLen=(U8)strlen(emailAddressMA)

setEmailAddress

◆ SharkSslCertDN_setLocality

#define SharkSslCertDN_setLocality (   o,
  localityMA 
)     (o)->locality=(const U8*)localityMA,(o)->localityLen=(U8)strlen(localityMA)

setLocality

◆ SharkSslCertDN_setOrganization

#define SharkSslCertDN_setOrganization (   o,
  organizationMA 
)     (o)->organization=(const U8*)organizationMA,(o)->organizationLen=(U8)strlen(organizationMA)

setOrganization

◆ SharkSslCertDN_setProvince

#define SharkSslCertDN_setProvince (   o,
  provinceMA 
)     (o)->province=(const U8*)provinceMA,(o)->provinceLen=(U8)strlen(provinceMA)

setProvince

◆ SharkSslCertDN_setUnit

#define SharkSslCertDN_setUnit (   o,
  unitMA 
)     (o)->unit=(const U8*)unitMA,(o)->unitLen=(U8)strlen(unitMA)

setUnit

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)
{
&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

◆ SharkSslCertInfo

The peer's certificate information returned by SharkSslCon_getCertInfo.

See also
SharkSslCertDN