This document describes some data types common to all I2P-protocols, like I2NP, I2CP, NTCP, etc.
</p>
<h2id="type_Integer">Integer</h2>
<h4>Description</h4>
<p>
Represents a nonnegative integer.
</p>
<h4>Contents</h4>
<p>
1 or more bytes in network byte order representing an unsigned integer
</p>
<h2id="type_Date">Date</h2>
<h4>Description</h4>
<p>
The number of milliseconds since midnight on January 1, 1970 in the GMT timezone.
If the number is 0, the date is undefined or null.
</p>
<h4>Contents</h4>
<p>
8 byte <ahref="#type_Integer">Integer</a>
</p>
<h2id="type_String">String</h2>
<h4>Description</h4>
<p>
Represents a UTF-8 encoded string.
</p>
<h4>Contents</h4>
<p>
1 or more bytes where the first byte is the number of bytes(not characters!) in the string and the remaining 0-255 bytes are the non-null terminated UTF-8 encoded character array
A certificate is a container for various receipts or proof of works used throughout the I2P network.
</p>
<h4>Contents</h4>
<p>
1 byte <ahref="#type_Integer">Integer</a> specifying certificate type, followed by a 2 <ahref="#type_Integer">Integer</a> specifying the size of the certificate payload, then that many bytes.
Defines the way to uniquely identify a particular router
</p>
<h4>Contents</h4>
<p>
<ahref="#type_PublicKey">PublicKey</a> followed by <ahref="#type_SigningPublicKey">SigningPublicKey</a> and then a <ahref="#type_Certificate">Certificate</a> entangled with the <ahref="#type_PublicKey">PublicKey</a>
A Destination defines a particular endpoint to which messages can be directed for secure delivery.
</p>
<h4>Contents</h4>
<p>
<ahref="#type_PublicKey">PublicKey</a> followed by a <ahref="#type_SigningPublicKey">SigningPublicKey</a> and then a <ahref="#type_Certificate">Certificate</a> entangled with the <ahref="#type_PublicKey">PublicKey</a>.
Defines the authorization for a particular tunnel to receive messages targeting a <ahref="#struct_Destination">Destination</a>.
</p>
<h4>Contents</h4>
<p>
<ahref="#struct_RouterIdentity">RouterIdentity</a> of the gateway router, then the <ahref="#type_TunnelId">TunnelId</a>, and then a start <ahref="#type_Date">Date</a> and finally an end <ahref="#type_Date">Date</a>
Contains all of the currently authorized <ahref="#struct_Lease">Lease</a>s for a particular <ahref="#struct_Destination">Destination</a>, the <ahref="#type_PublicKey">PublicKey</a> to which garlic messages can be encrypted,
and then the the <ahref="#type_SigningPublicKey">public key</a> that can be used to revoke this particular version of the structure. The <ahref="#struct_LeaseSet">LeaseSet</a> is one of the two structures stored in the network database(
the other being <ahref="#struct_RouterInfo">RouterInfo</a>), and is keyed under the SHA256 of the contained <ahref="#struct_Destination">Destination</a>.
</p>
<h4>Contents</h4>
<p>
<ahref="#struct_Destination">Destination</a>, followed by a <ahref="#type_PublicKey">PublicKey</a> for encryption, then a <ahref="#type_SigningPublicKey">SigningPublicKey</a> which can be used to revoke this version of the <ahref="#struct_LeaseSet">LeaseSet</a>,
then a 1 byte <ahref="#type_Integer">Integer</a> specifying how many <ahref="#struct_Lease">Lease</a> structures are in the set, followed by the actual <ahref="#struct_Lease">Lease</a> structures and finally a <ahref="#type_Signature">Signature</a> of the previous
bytes signed by the <ahref="#struct_Destination">Destination's</a><ahref="#type_SigningPrivateKey">SigningPrivateKey</a>
This structure defines the means to contact a router through a transport protocol.
</p>
<h4>Contents</h4>
<p>
1 byte <ahref="#type_Integer">Integer</a> defining the relative cost of using the address, where 0 is free and 255 is expensive, followed by the expiration <ahref="#type_Date">Date</a> after which the address should not be used, or if null, the address never expires.
After that comes a <ahref="#type_String">String</a> defining the transport protocol this router address uses. Finally there is a <ahref="#type_Mapping">Mapping</a> containing all of the transport specific options necessary to establish the connection, such as
Defines all of the data that a router wants to publish for the network to see. The <ahref="#struct_RouterInfo">RouterInfo</a> is one of two structures stored in the network database(the other being <ahref="#struct_LeaseSet">LeaseSet</a>, and is keyed under the SHA256 of
the contained <ahref="#struct_RouterIdentity">RouterIdentity</a>.
</p>
<h4>Contents</h4>
<p>
<ahref="#struct_RouterIdentity">RouterIdentity</a> followed by the <ahref="#type_Date">Date</a>, when the entry was published