Certificates

Certificates

Overview #

Certificates contain cryptography information for verifying Signatures. These certificates are also signed. The parent/child relationship between certificates, makes all the certificates effectively signed by ‘Root’, the public key for which is stored in NATIVE_FIRM.

Format #

OffsetSizeDescription
0x00x4Signature Type
0x4XSignature with Padding (aligning next data to 0x40 bytes)
0x4 + X0x40Issuer
0x44 + X0x4Key Type
0x48 + X0x40Name
0x88 + X0x4Expiration time as UNIX Timestamp, used at least for CTCert
0x8C + X*Public Key

Signature #

The signature method used to sign the certificate can be determined by checking the Signature Type:

The hash for the signature is calculated over the actual certificate data(from the start of the “Issuer”, to the end of the “Public Key”, aligned to 0x40 bytes).

Public Key #

Determining the type of public key stored, is done by checking the key type:

ValueKey Type
0x0RSA_4096
0x1RSA_2048
0x2Elliptic Curve

RSA #

This contains the Public Key(i.e. Modulus & Public Exponent)

4096 Bit #

OffsetSizeDescription
0x00x200Modulus
0x2000x4Public Exponent
0x2040x34Padding

2048 Bit #

OffsetSizeDescription
0x00x100Modulus
0x1000x4Public Exponent
0x1040x34Padding

ECC #

This contains the ECC public key, and is as follows:

OffsetSizeDescription
0x00x3CPublic Key
0x3C0x3CPadding