OPC UAapplications use Certificatesto store the Public Keysneeded for Asymmetric Cryptography operations. All SecurityProtocolsuse X.509 v3 Certificates(see X.509 v3) encoded using the DER format (see X690). Certificatesused by OPC UA applications shall also conform to RFC 3280which defines a profile for X.509 v3 Certificateswhen they are used as part of an Internet based application.

The ServerCertificateand ClientCertificateparameters used in the abstract OpenSecureChannelservice are instances of the Application Instance Certificate Data Type. 6.2.2describes how to create an X.509 v3 Certificatethat can be used as an Application Instance Certificate.

An Application Instance Certificateis a ByteStringcontaining the DER encoded form (see X690) of an X.509 v3 Certificate. This Certificateis issued by certifying authority and identifies an instance of an application running on a single host. The X.509 v3 fields contained in an Application Instance Certificateare described in Table 36. The fields are defined completely in RFC 3280.

Table 36also provides a mapping from the RFC 3280terms to the terms used in the abstract definition of an Application Instance Certificatedefined in OPC 10000-4.

Table 36– Application Instance Certificate

Name

OPC 10000-4Parameter Name

Description

Application Instance Certificate

An X.509 v3 Certificate.

version

version

shall be “V3”

serialNumber

serialNumber

The serial number assigned by the issuer.

signatureAlgorithm

signatureAlgorithm

The algorithm used to sign the Certificate.

signature

signature

The signature created by the Issuer.

issuer

issuer

The distinguished name of the Certificateused to create the signature.

The issuer field is completely described in RFC 3280.

validity

validTo, validFrom

When the Certificatebecomes valid and when it expires.

subject

subject

The distinguished name of the applicationInstance.

The Common Name attribute shall be specified and should be the productNameor a suitable equivalent. The Organization Name attribute shall be the name of the Organization that executes the application instance. This organization is usually not the vendor of the application.

Other attributes may be specified.

The subject field is completely described in RFC 3280.

subjectAltName

applicationUri,

hostnames

The alternate names for the applicationInstance.

Shall include a uniformResourceIdentifier which is equal to the applicationUri. The URI shall be a valid URL (see RFC 1738) or a valid URN (see RFC 2141).

Serversshall specify a partial or a fully qualified dNSNameor a staticIPAddresswhich identifies the machine where the applicationInstanceruns. Additional dNSNames may be specified if the machine has multiple names.

The subjectAltName fieldis completely described in RFC 3280.

publicKey

publicKey

The public key associated with the Certificate.

keyUsage

keyUsage

Specifies how the Certificatekey may be used.

Shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.

Other key uses are allowed.

extendedKeyUsage

keyUsage

Specifies additional key uses for the Certificate.

Shall specify 'serverAuth and/or clientAuth.

Other key uses are allowed.

authorityKeyIdentifier

(no mapping)

Provides more information about the key used to sign the Certificate. It shall be specified for Certificatessigned by a CA. It should be specified for self-signed Certificates.

Any X.509 v3 Certificatemay be signed by CA which means that validating the signature requires access to the X.509 v3 Certificatebelonging to the signing CA. Whenever an application validates a signature it must recursively build a chain of Certificatesby finding the issuer Certificate, validating the Certificateand then repeat the process for the issuer Certificate. The chain ends with a self-signed Certificate.

The number of CAs used in a system should be small so it is common to install the necessary CAs on each machine with an OPC UA application. However, applications have the option of including a partial or complete chain whenever they pass a Certificateto a peer during the SecureChannelnegotiation and during the CreateSession/ActivateSessionhandshake. All OPC UA applications shall accept partial or complete chains in any field that contains a DER encoded Certificate.

Chains are stored in a ByteStringby simply appending the DER encoded form of the Certificates. The first Certificateshall be the end Certificatefollowed by its issuer. If the root CA is sent as part of the chain it is last Certificateappended to the ByteString.

Chains are parsed by extracting the length of each Certificate from the DER encoding. For Certificates with lengths less than 65 535 bytes it is a MSB encoded UInt16 starting at the 3rdbyte.