BarcodeHeader

UIC barcode header - version 3.0.0

Encoding conventions

A barcode which is only static, and for which the security is in the system (e.g. security paper), does not need a signature. A barcode which is only static, and includes its own security, needs a level 1 signature and a corresponding key reference. A dynamic barcode including static and dynamic signatures needs the same elements as a static barcode, plus a level 2 signature.

The maximum size of a barcode is, per the Aztec specification ISO 24778, limited to 1914 bytes.

Module Info

Reference
BarcodeHeader
Numeric OID
1.3.6.1.4.1.17218.1.0.1.3.0

Exports

This module explicitly exports the following symbols:

BarcodeHeader

Imports

Assignments

BarcodeHeader

The basic entry point of the barcode.

SEQUENCE

This sequence contains the following fields:

format

This field SHALL be set to the byte string U3. This results in the version 3 header being prefixed with U3 at the start, allowing identification of this format of barcode header.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 2

contents
StandardSignedData

This type is concretely parameterised with the following:

DataType
Level2Data
KeyReference
NULL

Level2Data

SEQUENCE

This sequence contains the following fields:

level1Data
Level1Data
data Optional

Dynamic Content Data goes here.

SEQUENCE OF

This type is constrained in the following way:

Size

The length of the value must be greater than or equal to: 1

The length of the value must be less than or equal to: 8

Data

This type is concretely parameterised with the following:

ElementSet
Level2DataElements

This type is constrained in the following way:

Fields

The type must satisfy the following field constraints, other fields are unconstrained:

Field Presence Value
format No stipulation

Inverse

Any value, except any satisfying the following:

Union

Any of the following can be true:

Single value

The value must be exactly: !I

OR

Single value

The value must be exactly: !C

OR

Single value

The value must be exactly: !P

CompanyKeyReference

Provider of the level 1 signature.

SEQUENCE

This sequence contains the following fields:

securityProvider
CompanyCode
keyId
INTEGER

This type is constrained in the following way:

Range

The value must be greater than or equal to: 0

The value must be less than or equal to: 99999

Level1Data

CHOICE

The value of this choice may be one of the following:

directlyIssued

Must use the standard variety, message recovery format to be decided upon at a later date. Standard variety signature calculated over BarcodeTBSData.

SignedData

This type is concretely parameterised with the following:

DataType
BarcodeData
KeyReference
CompanyKeyReference
subIssued

Must not be used, format to be decided upon at a later date.

SEQUENCE

This sequence contains the following fields:

endEntityCertificate

Standard variety signature calculated over EndEntityCertificateTBSData.

SignedData

This type is concretely parameterised with the following:

DataType
EndEntityCertificate
KeyReference
CompanyKeyReference
barcodeData
SignedData

This type is concretely parameterised with the following:

DataType
BarcodeData
KeyReference
NULL

This type is constrained in the following way:

User-defined

This constraint is declared in a comment in the source code.

BarcodeTBSData

Concretely parameterised form for use in calculating the signature for the directlyIssued variant of Level1Data.

StandardTBSData

This type is concretely parameterised with the following:

DataType
BarcodeData
KeyReference
CompanyKeyReference

SignedData

Parameterised

This assignment is parameterised, accepting the following parameters:

DataType
KeyReference
CHOICE

The value of this choice may be one of the following:

standard
StandardSignedData

This type is concretely parameterised with the following:

DataType
Parameter DataType
KeyReference
Parameter KeyReference
messageRecovery
MessageRecoverySignature

This type is constrained in the following way:

User-defined

This constraint is declared in a comment in the source code.

StandardSignedData

Parameterised

Standardised container for conveying a message with an optional signature providing authenticity and integrity guarantees.

This assignment is parameterised, accepting the following parameters:

DataType

The type defining the message to be conveyed.

KeyReference

The type allowing differentiation of which key pair was used to sign the message.

SEQUENCE

This sequence contains the following fields:

tbs
Parameter DataType
signature Optional

The signature is calculated over the canonical unaligned PER (CUPER) encoding of StandardTBSData{DataType, KeyReference}. Note: when KeyReference is NULL this is equivalent to the CUPER encoding of DataType.

Being unset only permitted when no security is required.

SEQUENCE

This sequence contains the following fields:

keyReference
Parameter KeyReference
data
Signature

StandardTBSData

Parameterised

This assignment is parameterised, accepting the following parameters:

DataType
KeyReference
SEQUENCE

This sequence contains the following fields:

keyReference
Parameter KeyReference
tbs
Parameter DataType

Signature

CHOICE

The value of this choice may be one of the following:

es256

ECDSA using the P-256 curve and SHA-256.

DSSSignature

This type is concretely parameterised with the following:

len
32
es256k

ECDSA using the secp256k1 curve and SHA-256.

DSSSignature

This type is concretely parameterised with the following:

len
32
es384

ECDSA using the NIST P-384 curve and SHA-384.

DSSSignature

This type is concretely parameterised with the following:

len
48
es512

ECDSA using the NIST P-521 curve and SHA-512.

DSSSignature

This type is concretely parameterised with the following:

len
66
ed25519
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 64

ed448
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 114

hs256

HMAC using SHA-256, not permitted except by bilateral agreement.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 32

hs384

HMAC using SHA-384, not permitted except by bilateral agreement.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 48

hs512

HMAC using SHA-512, not permitted except by bilateral agreement.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 64

dsa1

DSA-1024 using SHA-1, not recommended for new deployments.

DSSSignature

This type is concretely parameterised with the following:

len
20
dsa224

DSA-2048 using SHA-224, not recommended for new deployments.

DSSSignature

This type is concretely parameterised with the following:

len
32
dsa256

DSA-2048 using SHA-256, not recommended for new deployments.

DSSSignature

This type is concretely parameterised with the following:

len
32
reserved1

Space for future signature modes, e.g. Post-Quantum Cryptography.

NULL
reserved2

Space for future signature modes, e.g. Post-Quantum Cryptography.

NULL
reserved3

Space for future signature modes, e.g. Post-Quantum Cryptography.

NULL
other
SEQUENCE

This sequence contains the following fields:

algId
OBJECT IDENTIFIER
signature
OCTET STRING

DSSSignature

Parameterised

A generic container for the conveyance of Digital Signature Scheme signatures, e.g. ECDSA and DSA.

This assignment is parameterised, accepting the following parameters:

len

The length, in bytes, of each of r and s. That is, half the total signature length.

INTEGER
SEQUENCE

This sequence contains the following fields:

r
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: Parameter len

s
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: Parameter len

PublicKey

CHOICE

The value of this choice may be one of the following:

nistP256
ECPublicKey

This type is concretely parameterised with the following:

len
32
secp256K1
ECPublicKey

This type is concretely parameterised with the following:

len
32
nistP384
ECPublicKey

This type is concretely parameterised with the following:

len
48
nistP521
ECPublicKey

This type is concretely parameterised with the following:

len
66
ed25519
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 32

ed448
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 57

reserved

Space for future public key formats, e.g. Post-Quantum Cryptography.

NULL
other

DER encoded SubjectPublicKeyInfo.

OCTET STRING

ECPublicKey

Parameterised

This assignment is parameterised, accepting the following parameters:

len

The length, in bytes, required to represent the x coördinate on a curve.

INTEGER
SEQUENCE

This sequence contains the following fields:

x
OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: Parameter len

yIsOdd
BOOLEAN

MessageRecoverySignature

Purposefully left blank, format to be decided upon at a later date.

NULL

EndEntityCertificate

Purposefully left blank, format to be decided upon at a later date.

NULL

BarcodeData

SEQUENCE

This sequence contains the following fields:

data

This field MUST contain at most one well-known UIC data type (e.g. FCBn).

SEQUENCE OF

This type is constrained in the following way:

Size

The length of the value must be greater than or equal to: 1

The length of the value must be less than or equal to: 16

Data

This type is concretely parameterised with the following:

ElementSet
Level1DataElements

This type is constrained in the following way:

Fields

The type must satisfy the following field constraints, other fields are unconstrained:

Field Presence Value
format No stipulation

Inverse

Any value, except any satisfying the following:

Union

Any of the following can be true:

Single value

The value must be exactly: !I

OR

Single value

The value must be exactly: !C

OR

Single value

The value must be exactly: !P

level2PublicKey Optional
PublicKey
endOfValidity Optional

End of the validity of the barcode. After this date and time the barcode needs to be regenerated by the provider of the ticket. The provider of the bar code MUST ensure that the endOfValidity given here does not exceed the validity of the key pair used on level 2.

Timestamp
validityDuration Optional

Validity duration in seconds of the barcode with reference to the time stamp in the dynamic content data.

INTEGER

This type is constrained in the following way:

Range

The value must be greater than or equal to: 1

The value must be less than or equal to: 3600