BT4PT-EncryptedDataV1-0

BT4PT Encrypted Data - DRAFT.

Module Info

Reference
BT4PT-EncryptedDataV1-0
Numeric OID
1.3.6.1.4.1.17218.1.2.11.1.0

Imports

Assignments

EncryptedData

This structure carries data to be included in an envelope that is readable only by the parties to which it is encrypted.

The data elements are encrypted with a Content Encryption Key that is used only once. The Content Encryption Key is then wrapped for each recipient, using a key derived from an X25519 key agreement between an ephemeral key pair generated by the issuer and a long-term key pair of the recipient.

The Content Encryption Key is a 128-bit key, which SHALL be generated by a cryptographically secure pseudo-random number generator for each EncryptedData value, and SHALL NOT be used for any other encryption.

SEQUENCE

This sequence contains the following fields:

header

The information each recipient requires to recover the Content Encryption Key.

EncryptedDataHeader
ciphertext

The encrypted data, being the ciphertext followed by the 16-byte authentication tag, as output by AES-128-GCM per , with:

  • the key being the Content Encryption Key.
  • the 96-bit initialisation vector consisting of 12 null bytes.
  • the additional authenticated data being the Canonical Unaligned Packed Encoding Rules encoding of the header field.
  • the plaintext being the Canonical Unaligned Packed Encoding Rules encoding of InnerData.
OCTET STRING

EncryptedDataHeader

This header contains the information identifying to whom the data is encrypted, and the data required to obtain the Content Encryption Key.

It contains an ephemeral X25519 key and the wrapped key per recipient. The ephemeral key pair SHALL be generated by a cryptographically secure pseudo-random number generator for each encrypted data element, and SHALL NOT be used for any other encrypted data element. The ephemeral private key SHALL be destroyed once the wrapping key of every recipient has been derived.

SEQUENCE

This sequence contains the following fields:

ephemeralPublicKey

The public key of an ephemeral X25519 key pair, encoded as specified in .

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 32

recipients

The recipients of the encrypted data. No two entries SHALL have the same key.

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

Recipient

Recipient

This structure contains the per-recipient info required to obtain the Content Encryption Key.

The Content Encryption Key SHALL be wrapped using the AES Key Wrap algorithm of , using the default initial value, and a 256-bit wrapping key derived as follows:

  1. Let SK be the 32-byte output of the X25519 function of , applied to the ephemeral private key and the long-term public key identified by key when encrypting, or to the long-term private key identified by key and ephemeralPublicKey when decrypting.
  2. If SK consists only of null bytes, the key agreement has failed, and the wrapping key SHALL NOT be derived.
  3. The wrapping key is the 32-byte output of HKDF with SHA-256 per , with the input being the keying material SK, the salt being the value of ephemeralPublicKey, and info being the ASCII string BT4PT-EncryptedDataV1-0 followed by the 32-byte long-term public key identified by key, encoded as specified in .
SEQUENCE

This sequence contains the following fields:

key

Identifies the long-term X25519 key of the recipient to which the Content Encryption Key is wrapped.

RecipientKey
wrappedKey

The wrapped Content Encryption Key.

OCTET STRING

This type is constrained in the following way:

Size

The length of the value must exactly: 24

RecipientKey

This data structure identifies the long-term X25519 key of a recipient, by the Key Agreement Key ID of the Key Agreement Certificate certifying it.

SEQUENCE

This sequence contains the following fields:

securityProvider

The Security Provider holding the long-term key, being the Company Code in the Subject Alternative Name extension of the Key Agreement Certificate.

CompanyCode
keyId

The Key ID in the Key Agreement Key ID extension of the Key Agreement Certificate.

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

InnerData

This structure, when encoded with the Canonical Unaligned Packed Encoding Rules, is the plaintext that is to be encrypted and included in a EncryptedData instance.

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
EncryptedDataElements

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

EncryptedDataElements

These are the data elements that are permitted to appear in an encrypted data element. 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
LUG1 LuggageTag cuperEncoding LuggageTagConstraints
OTK1 TotpKey cuperEncoding NULL
Other members may be added at runtime.