BT4PT-EnvelopeV1-0

BT4PT Envelope - DRAFT.

The envelope SHALL be encoded with the Canonical Aligned Packed Encoding Rules, as this makes it easier to work with in constrained environments, such as HSMs. Data elements within the header SHOULD be encoded with the Canonical Unaligned Packed Encoding Rules, for space savings.

Module Info

Reference
BT4PT-EnvelopeV1-0
Numeric OID
1.3.6.1.4.1.17218.1.2.2.1.0

Imports

Assignments

BT4PTEnvelope

This data structure is the basic entry point of the envelope. A BT4PT envelope SHALL consist of the bytes resulting from encoding this data structure using the Canonical Aligned Packed Encoding Rules, per .

CHOICE

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

unsigned

This variant contains the list of data elements that the envelope encodes, in an unsigned fashion, with no additional security data.

This variant SHALL only be used where no security is required. That is, when an unsigned envelope is considered suitable for the application.

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
SecurityProviderDataElements

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

signed

This variant is used for a signed envelope. It contains the list of data elements that the envelope encodes, along with a signature from the Security Provider, the certificate for the end-entity that output this envelope, and an optional binding of this envelope to a end-device's public key.

SEQUENCE

This sequence contains the following fields:

data

This field contains the Security Provider Signed Data, as well as any additional data to be signed by the device.

DeviceSignedData
deviceSignature Optional

This field is used as part of the device binding of envelopes. When an envelope is bound to a Presentment Device, it SHALL contain a signature, calculated over the Canonical Aligned Packed Encoding Rules encoding of DeviceSignedData, using the device held private key corresponding to the public key provided in the deviceBinding.devicePublicKey field of SecurityProviderSignedData.

If the deviceBinding field of the SecurityProviderSignedData is unset, and this field is set, the envelope SHALL be construed as invalid. If the deviceBinding field of the SecurityProviderSignedData is set, and this field is unset, the envelope SHALL be construed as invalid.

Signature

DeviceSignedData

SEQUENCE

This sequence contains the following fields:

data

This field contains the data signed by the Security Provider, in a message recovery fashion. Its inner data is the Canonical Aligned Packed Encoding Rules encoding of SecurityProviderSignedData, prefixed with the first 16 bytes of its hash, using the hash function of the curve of the signature, as specified in .

MessageRecoverySignature
certificate

This field contains the end-entity certificate used to sign the data field.

EndEntityCertificate
timestamp Optional

This field contains the timestamp at which the Presentment Device generated the envelope.

This field SHALL be set if the deviceBinding field of the SecurityProviderSignedData is set, otherwise the envelope SHALL be construed as invalid. If this timestamp is more than the deviceBinding.validityDuration field of the SecurityProviderSignedData seconds in the past, the envelope SHALL be construed as invalid, subject to the clock tolerance specified in .

A Presentment Device SHALL NOT rely on its local clock alone when generating the timestamp of the device signed data. It SHALL determine the offset of its local clock from the time of a reliable source, such as the systems of the issuer, whenever it is online, and SHALL correct the timestamp by that offset. A Presentment Device whose clock is set incorrectly, whether accidentally or deliberately, will otherwise generate envelopes that are rejected as expired or as having a timestamp in the future.

TimestampSeconds
deviceData Optional

This field contains data elements signed only by the Presentment Device, or not signed at all. Note: the inclusion of device data without the SecurityProviderSignedData.deviceBinding field being set is not an error. It is permissible to include unauthenticated device data, for example as a debugging aid, or for the inclusion of a TOTP (see ).

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
DeviceDataElements

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

SecurityProviderSignedData

SEQUENCE

This sequence contains the following fields:

data

This field contains data elements signed by the Security Provider.

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: 64

Data

This type is concretely parameterised with the following:

ElementSet
SecurityProviderDataElements

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

endOfValidity Optional

This field allows for the encoding of an expiry date for the envelope. After this timestamp the envelope needs to be regenerated by the Security Provider for it to remain valid.

Note: this is different from the ticket validity encoded in a data element. An envelope could be valid for more or for less time than the transport product encoded in a data element.

Timestamp
deviceBinding Optional

This field allows for the binding of a barcode envelope to a specific end-device.

SEQUENCE

This sequence contains the following fields:

devicePublicKey

If device binding is in use, this field SHALL contain the public-key of the Presentment Device.

CHOICE

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

nistP256

A point on the NIST P-256 curve.

ECPublicKey

This type is concretely parameterised with the following:

len
32
nistP384

A point on the NIST P-384 curve.

ECPublicKey

This type is concretely parameterised with the following:

len
48
nistP521

A point on the NIST P-521 curve.

ECPublicKey

This type is concretely parameterised with the following:

len
66
ed25519

The compressed encoding of an Ed25519 point, per .

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 32

ed448

The compressed encoding of an Ed448 point, per .

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 57

other

If the public-key is not one of the above types, this variant SHALL be used, and SHALL contain an X.509 SubjectPublicKeyInfo structure, encoded according to the Distinguished Encoding Rules per .

OCTET STRING
validityDuration

This field sets how long, in seconds, an envelope signed by the Presentment Device stays valid after generation. This value SHOULD NOT be less than 30 seconds, as a shorter duration leaves little margin for clock skew, etc.

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

SecurityProviderDataElements

The following data elements can appear in the data field of the SecurityProviderSignedData structure. Note: other data elements, not defined in this standard, are also permitted to appear.

OBJECT SET

This object set has the following members:

&id &Type &encoding &Constraints
MMT1 MultiModalTicket cuperEncoding MultiModalTicketConstraints
FPD1 FixedPoint cuperEncoding FixedPointConstraints
LUG1 LuggageTag cuperEncoding LuggageTagConstraints
ENC1 EncryptedData cuperEncoding NULL
HSM1 HSMTrace cuperEncoding HSMTraceConstraints
REV1 RevocationRequest cuperEncoding NULL
FCB3 UicRailTicketData cuperEncoding NULL
FCB2 UicRailTicketData cuperEncoding NULL
FCB13 UicRailTicketData cuperEncoding NULL
Other members may be added at runtime.

DeviceDataElements

The following data elements can appear in the deviceData field of the DeviceSignedData structure. Note: other data elements, not defined in this standard, are also permitted to appear.

The difference between DCD1 and DCD1A is that the first uses unaligned packed encoding and the second uses aligned packed encoding; otherwise, they are identical.

OBJECT SET

This object set has the following members:

&id &Type &encoding &Constraints
DCD1 DynamicContent cuperEncoding NULL
DCD1A DynamicContent caperEncoding NULL
OTP1 TotpValue rawEncoding NULL
OTP1Q TotpValue rawEncoding NULL
FDC1 UicDynamicContentData cuperEncoding NULL
Other members may be added at runtime.

ECKNRSignature

Parameterised

Message recovery signature as per .

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

The output r of the ECKNR signature process.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: Parameter len

s

The output s of the ECKNR signature process.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: Parameter len

remainder

The non-recoverable data part. That is, the remaining data of the ECKNR signature process.

OCTET STRING

MessageRecoverySignature

This data structure contains a Elliptic Curve KCDSA/Nyberg-Rueppel message recovery signature. Such a signature is defined in

CHOICE

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

es256

An ECKNR signature over the NIST P-256 curve with the SHA-256 hash function.

ECKNRSignature

This type is concretely parameterised with the following:

len
32
es384

An ECKNR signature over the NIST P-384 curve with the SHA-384 hash function.

ECKNRSignature

This type is concretely parameterised with the following:

len
48
es512

An ECKNR signature over the NIST P-521 curve with the SHA-512 hash function.

ECKNRSignature

This type is concretely parameterised with the following:

len
66

Signature

This data structure contains a non-message recovery (i.e. standard) signature.

CHOICE

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

es256

An ECDSA signature over the NIST P-256 curve with the SHA-256 hash function.

DSSSignature

This type is concretely parameterised with the following:

len
32
es384

An ECDSA signature over the NIST P-384 curve with the SHA-384 hash function.

DSSSignature

This type is concretely parameterised with the following:

len
48
es512

An ECDSA signature over the NIST P-521 curve with the SHA-512 hash function.

DSSSignature

This type is concretely parameterised with the following:

len
66
ed25519

An EdDSA signature over Curve25519.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 64

ed448

An EdDSA signature over Curve448.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 114

other

If the signature scheme is not one of the above types, this variant SHALL be used.

SEQUENCE

This sequence contains the following fields:

algId

An object identifier specifying which signature scheme is in use.

OBJECT IDENTIFIER
signature

The encoded signature, as per the above algId.

OCTET STRING