Difference between revisions of "Unit X.509"

From Ultibo.org
Jump to: navigation, search
Line 641: Line 641:
 
|  
 
|  
 
|-
 
|-
| <code>function ImportPEM(ABuffer:Pointer; ASize:Integer):TX509Certificate; virtual;</code>
+
| <code>function ImportPEM(ABuffer:Pointer; var ASize:Integer):TX509Certificate; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ExportDER(ABuffer:Pointer; var ASize:Integer; ACertificate:TX509Certificate):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ExportPEM(ABuffer:Pointer; var ASize:Integer; AStart:TX509Certificate):Boolean; virtual;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 734: Line 742:
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>function ImportPEM(ABuffer:Pointer; ASize:Integer; AParent:TX509Certificate):TX509Certificate; virtual;</code>
+
| <code>function ImportPEM(ABuffer:Pointer; var ASize:Integer; AParent:TX509Certificate):TX509Certificate; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ExportDER(ABuffer:Pointer; var ASize:Integer; ACertificate:TX509Certificate):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ExportPEM(ABuffer:Pointer; var ASize:Integer; AStart:TX509Certificate):Boolean; virtual;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 778: Line 794:
 
| <code>FData:PByte;</code>
 
| <code>FData:PByte;</code>
 
| Copy of certificate data from import
 
| Copy of certificate data from import
 +
|-
 +
| <code>FSize:LongWord;</code>
 +
| Total size of certificate data
 
|-
 
|-
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
Line 960: Line 979:
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>function ImportPEM(ABuffer:Pointer; ASize:Integer):Boolean; virtual;</code>
+
| <code>function ImportPEM(ABuffer:Pointer; var ASize:Integer):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ExportDER(ABuffer:Pointer; var ASize:Integer):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ExportPEM(ABuffer:Pointer; var ASize:Integer):Boolean; virtual;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-

Revision as of 05:36, 5 May 2018

Return to Unit Reference


Description


Ultibo X.509 interface unit

X.509 is a standard that defines the format of public key certificates. An X.509 certificate contains a public key and an identity (a hostname, or an organization, or an individual), and is either signed by a certificate authority or self-signed. When a certificate is signed by a trusted certificate authority, or validated by other means, someone holding that certificate can rely on the public key it contains to establish secure communications with another party, or validate documents digitally signed by the corresponding private key.

This unit currently only provides the basic functionality required to read and parse an X.509 certificate in DER or PEM format and extract basic information such as the issuer, subject, validity, algorithm and public key.

It is expected that this unit will be expanded to incorporate additional functions over time.

Constants



[Expand]
X509 specific constants X509_*


[Expand]
X509 name attribute X509_NAME_ATTR_*


[Expand]
X509 validate X509_VALIDATE_*


[Expand]
X509 certificate version X509_CERT_V*


[Expand]
X509 certificate extension X509_EXT_*


[Expand]
X509 certificate key usage X509_KEY_USAGE_*


[Expand]
X509 certificate extended key usage X509_EXT_KEY_USAGE_*


Type definitions



X509 serial number

[Expand]

PX509SerialNumber = ^TX509SerialNumber;

TX509SerialNumber = record

X509 name attribute

[Expand]

PX509NameAttribute = ^TX509NameAttribute;

TX509NameAttribute = record

X509 name attributes

[Expand]

PX509NameAttributes = ^TX509NameAttributes;

TX509NameAttributes = array[0..X509_MAX_NAME_ATTRIBUTES - 1] of TX509NameAttribute;

X509 algorithm identifier

[Expand]

PX509AlgorithmIdentifier = ^TX509AlgorithmIdentifier;

TX509AlgorithmIdentifier = record

X509 public key

[Expand]

PX509PublicKey = ^TX509PublicKey;

TX509PublicKey = record

X509 signature

[Expand]

PX509Signature = ^TX509Signature;

TX509Signature = record

X509 RSA public key

[Expand]

PX509RSAPublicKey = ^TX509RSAPublicKey;

TX509RSAPublicKey = record

X509 RSA private key

[Expand]

PX509RSAPrivateKey = ^TX509RSAPrivateKey;

TX509RSAPrivateKey = record

X509 ECDSA public key

[Expand]

PX509ECDSAPublicKey = ^TX509ECDSAPublicKey;

TX509ECDSAPublicKey = record

X509 ECDSA private key

[Expand]

PX509ECDSAPrivateKey = ^TX509ECDSAPrivateKey;

TX509ECDSAPrivateKey = record


Class definitions



X509 name

[Expand]

TX509Name = class(TObject)

X509 certificate

[Expand]

TX509Certificate = class;

X509 certificate list

[Expand]

TX509CertificateList = class(TObject)

X509 certificate chain

[Expand]

TX509CertificateChain = class(TObject)

X509 certificate

[Expand]

TX509Certificate = class(TObject)


Public variables


None defined

Function declarations



X509 helper functions

[Expand]
function X509NameAttributeTypeToString(AType:LongWord):String;
Description: To be documented


Return to Unit Reference