SharkSSL™ Embedded SSL/TLS Stack

Detailed Description

The peer's certificate information returned by SharkSslCon_getCertInfo.

See also
SharkSslCertDN

#include <SharkSSL.h>

Data Fields

U16 snLen
 Length of 'sn' (serial number)
 
U8 version
 Certificate version is offset at 0 so add +1 for actual version number.
 
U8 CAflag
 The Certificate Authority flag (CA) is set to one if the certificate is a CA i.e. More...
 
U8 * sn
 Binary serial number. More...
 
U8 * timeFrom
 Certificate is valid from date (in Time format: [YY]YYMMDDHHMMSSZ) UTCTime: 2-digit year; GeneralizedTime: 4-digit year (years > 2050)
 
U8 * timeTo
 Certificate expiration date (in Time format: [YY]YYMMDDHHMMSSZ) UTCTime: 2-digit year; GeneralizedTime: 4-digit year (years > 2050) GeneralizedTime: 4-digit year for years > 2050.
 
SharkSslCertDN issuer
 The entity who has signed and issued the certificate (RFC 2459 4.1.2.4)
 
SharkSslCertDN subject
 The entity associated with the public key (RFC 2459 4.1.2.6).
 
U8 * subjectAltNamesPtr
 Subject Alternative Names subjectAltNamesPtr is a pointer to an ASN1 sequence, whose length is subjectAltNamesLen. More...
 
U8 timeFromLen
 Length of 'timeFrom'.
 
U8 timeToLen
 Length of 'timeTo'.
 
struct SharkSslCertInfoparent
 Pointer to parent node when the SharkSslCertInfo object is part of a certificate chain. More...
 

Field Documentation

◆ CAflag

U8 SharkSslCertInfo::CAflag

The Certificate Authority flag (CA) is set to one if the certificate is a CA i.e.

a root certificate.

◆ parent

struct SharkSslCertInfo* SharkSslCertInfo::parent

Pointer to parent node when the SharkSslCertInfo object is part of a certificate chain.

You walk up the chain until you reach the root.

◆ sn

U8* SharkSslCertInfo::sn

Binary serial number.

The length is provided in 'snLen'

◆ subjectAltNamesPtr

U8* SharkSslCertInfo::subjectAltNamesPtr

Subject Alternative Names subjectAltNamesPtr is a pointer to an ASN1 sequence, whose length is subjectAltNamesLen.

Use the SubjectAltNameEnumerator/SubjectAltName struct as in the SharkSslCon_trusted function in SharkSslEx.c The following example is from certcheck.c:

U8 *tp = SubjectAltName_getPtr(&s);
if (SUBJECTALTNAME_IPADDRESS == SubjectAltName_getTag(&s))
{
xprintf((" IP address: "));
while (l--)
{
xprintf(("%d", *tp++));
if (l)
{
xprintf(("."));
}
}
xprintf(("\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