canm.003.001.02
The KeyExchangeInitiation message can be initiated by any party and received by any party (acquirer, agent or issuer). This message is used to initiate a cryptographic key activity (request of a key change, request of the verification of a key, etc.).
Message Construction
Every ISO20022 message has at the highest level what we call ‘building blocks’. Because the message is constructed as immutable records, the association is by composition. Below you can see the relationship between the message and its constituent building blocks: For comparison, see the ISO20022 official specification
classDiagram
direction LR
%% KeyExchangeInitiationV02 recursion level 0 with max 0
KeyExchangeInitiationV02 *-- "1..1" Header44 : Header
KeyExchangeInitiationV02 *-- "1..1" KeyExchangeInitiation1 : Body
KeyExchangeInitiationV02 *-- "0..1" ContentInformationType20 : SecurityTrailer
Now, we will zero-in one-by-one on each of these building blocks.
Header building block
Information related to the management of the protocol. Set of characteristics related to the protocol. For comparison, see the ISO20022 official specification
classDiagram
direction tb
%% Header44 recursion level 0 with max 1
class Header44{
MessageFunction MessageFunction25Code
ProtocolVersion IsoMax2048Text
ExchangeIdentification IsoMax35Text
RetransmissionCounter IsoMax3NumericText
CreationDateTime IsoISODateTime
}
Header44 *-- "0..1" BatchManagementInformation1 : BatchManagementInformation
Header44 *-- "1..1" GenericIdentification172 : InitiatingParty
Header44 *-- "0..1" GenericIdentification172 : RecipientParty
Header44 *-- "0..0" AdditionalData1 : TraceData
Header44 *-- "0..0" Traceability7 : Traceability
%% BatchManagementInformation1 recursion level 1 with max 1
class BatchManagementInformation1{
CollectionIdentification IsoMax35Text
BatchIdentification IsoMax35Text
MessageSequenceNumber IsoMax15NumericText
MessageChecksumInputValue IsoMax140Binary
}
%% GenericIdentification172 recursion level 1 with max 1
class GenericIdentification172{
Identification IsoMax35Text
Type PartyType17Code
OtherType IsoMax35Text
Assigner PartyType18Code
Country IsoMin2Max3AlphaText
ShortName IsoMax35Text
}
%% GenericIdentification172 recursion level 1 with max 1
class GenericIdentification172{
Identification IsoMax35Text
Type PartyType17Code
OtherType IsoMax35Text
Assigner PartyType18Code
Country IsoMin2Max3AlphaText
ShortName IsoMax35Text
}
%% AdditionalData1 recursion level 1 with max 1
class AdditionalData1{
Type IsoMax35Text
Value IsoMax2048Text
}
%% Traceability7 recursion level 1 with max 1
class Traceability7{
TraceDateTimeIn IsoISODateTime
TraceDateTimeOut IsoISODateTime
}
Traceability7 *-- "1..1" GenericIdentification172 : RelayIdentification
Header44 members
| Member name | Description | Data Type / Multiplicity |
|---|---|---|
| MessageFunction | Identifies the type of process related to the message. | MessageFunction25Code - Required 1..1 |
| ProtocolVersion | Version of the acquirer to issuer protocol specifications. | IsoMax2048Text - Required 1..1 |
| ExchangeIdentification | Unique identification of an exchange of messages between two parties. | IsoMax35Text - Optional 0..1 |
| RetransmissionCounter | Number of retransmission of the message. Incremented by one for each retransmission. | IsoMax3NumericText - Optional 0..1 |
| CreationDateTime | Date and time at which the message was sent. | IsoISODateTime - Required 1..1 |
| BatchManagementInformation | Information related to the batch and the collection to which the message belongs if any. | BatchManagementInformation1 - Optional 0..1 |
| InitiatingParty | Unique identification of the partner that has initiated the exchange. | GenericIdentification172 - Required 1..1 |
| RecipientParty | Unique identification of the partner that is the recipient of the message exchange. | GenericIdentification172 - Optional 0..1 |
| TraceData | Information sent in the request message to be returned in the response one, for instance to help in the retrieval of the context of the exchange. ISO 8583:93/2003 bit 59 | AdditionalData1 - Unknown 0..0 |
| Traceability | Identification of partners involved in exchange from the merchant to the issuer, with the relative timestamp of their exchanges. | Traceability7 - Unknown 0..0 |
Body building block
Information related to a key exchange activity. Information related to a key exchange activity. For comparison, see the ISO20022 official specification
classDiagram
direction tb
%% KeyExchangeInitiation1 recursion level 0 with max 1
KeyExchangeInitiation1 *-- "0..1" Context8 : Context
KeyExchangeInitiation1 *-- "1..1" Transaction100 : Transaction
KeyExchangeInitiation1 *-- "0..0" ProtectedData1 : ProtectedData
KeyExchangeInitiation1 *-- "0..0" SupplementaryData1 : SupplementaryData
%% Context8 recursion level 1 with max 1
Context8 *-- "0..1" TransactionContext5 : TransactionContext
%% Transaction100 recursion level 1 with max 1
class Transaction100{
KeyExchangeFunction CardServiceType5Code
OtherKeyExchangeFunction IsoMax35Text
MessageReason IsoExact4NumericText
AlternateMessageReason IsoMax35Text
KeyExchangeType KeyType1Code
OtherKeyExchangeType IsoMax35Text
}
Transaction100 *-- "1..1" TransactionIdentification12 : TransactionIdentification
Transaction100 *-- "0..1" KeyExchangeData1 : KeyExchangeData
Transaction100 *-- "0..0" AdditionalFee1 : AdditionalFees
Transaction100 *-- "0..0" AdditionalData1 : AdditionalData
%% ProtectedData1 recursion level 1 with max 1
class ProtectedData1{
ContentType ContentType3Code
}
ProtectedData1 *-- "0..1" EnvelopedData6 : EnvelopedData
ProtectedData1 *-- "0..1" EncryptedData1 : EncryptedData
%% SupplementaryData1 recursion level 1 with max 1
class SupplementaryData1{
PlaceAndName IsoMax350Text
}
SupplementaryData1 *-- "1..1" IsoSupplementaryDataEnvelope1 : Envelope
KeyExchangeInitiation1 members
| Member name | Description | Data Type / Multiplicity |
|---|---|---|
| Context | Contains or describes conditions and characteristics of the transaction. | Context8 - Optional 0..1 |
| Transaction | Details of an exchange or interaction between parties to perform a specific function. | Transaction100 - Required 1..1 |
| ProtectedData | Contains protected data and the attributes used to protect the data. | ProtectedData1 - Unknown 0..0 |
| SupplementaryData | Additional information that can not be captured in the structured fields and/or other specific block. | SupplementaryData1 - Unknown 0..0 |
SecurityTrailer building block
Trailer of the message containing a MAC General cryptographic message syntax (CMS) containing encrypted data. For comparison, see the ISO20022 official specification
classDiagram
direction tb
%% ContentInformationType20 recursion level 0 with max 1
class ContentInformationType20{
MAC IsoMax8HexBinaryText
}
ContentInformationType20 *-- "1..1" MACData1 : MACData
%% MACData1 recursion level 1 with max 1
class MACData1{
Control IsoExact1HexBinaryText
KeySetIdentifier IsoMax8NumericText
DerivedInformation IsoMax32HexBinaryText
Algorithm IsoMax2NumericText
KeyLength IsoMax4NumericText
KeyProtection IsoMax2NumericText
KeyIndex IsoMax5NumericText
PaddingMethod IsoMax2NumericText
InitialisationVector IsoMax32HexBinaryText
}
ContentInformationType20 members
| Member name | Description | Data Type / Multiplicity |
|---|---|---|
| MACData | Type of data protection. ISO 8583:87 bit 53 or 110 ISO 8583:93 bit 53 or 111 ISO 8583:2003 bit 53 or 50 | MACData1 - Required 1..1 |
| MAC | Message Authentication Code data. Binary, length of 8 ISO 8583 bit 64 or bit 128 | IsoMax8HexBinaryText - Required 1..1 |
Extensibility and generalization considerations
To facilitate generalized design patterns in the system, the KeyExchangeInitiationV02 implementation follows a specific implementaiton pattern. First of all, KeyExchangeInitiationV02 impleemnts IOuterRecord indicating it is the outermost logical part of the message definition. Like all message wrappers, KeyExchangeInitiationV02Document implements IOuterDocument. Because KeyExchangeInitiationV02 implements IOuterDocument, it is a suitable template parameter for IOuterDocument, and causes the internal ‘Message’ to be of type KeyExchangeInitiationV02.
classDiagram
class IOuterRecord
KeyExchangeInitiationV02 --|> IOuterRecord : Implements
KeyExchangeInitiationV02Document --|> IOuterDocument~KeyExchangeInitiationV02~ : Implements
class IOuterDocument~KeyExchangeInitiationV02~ {
KeyExchangeInitiationV02 Message
}
Document wrapper for serialization
The only real purpose KeyExchangeInitiationV02Document serves is to cause the document to be serialized into the ‘urn:iso:std:iso:20022:tech:xsd:canm.003.001.02’ namespace. Therefore, it will probably be the usual practice to build the message and construct this wrapper at the last minute using KeyExchangeInitiationV02.ToDocument() method. The returned KeyExchangeInitiationV02Document value will serialize correctly according to ISO 20022 standards.
classDiagram
KeyExchangeInitiationV02Document *-- KeyExchangeInitiationV02 : Document
Sample of message format
This is an abbreviated version of what the message should look like.
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:canm.003.001.02">
<KeyXchgInitn>
<Hdr>
<!-- Header inner content -->
</Hdr>
<Body>
<!-- Body inner content -->
</Body>
<SctyTrlr>
<!-- SecurityTrailer inner content -->
</SctyTrlr>
</KeyXchgInitn>
</Document>
Data from ISO specification
This is the technical data from the specification document.
<messageDefinition
xmi:id="_2CqhVVWVEeeiG_nL4vgKnQ"
nextVersions="_oOlvsYv6EeumSPwlS1PkxQ"
previousVersion="_tdBdMHvGEeSCJdwgzb6SFw"
name="KeyExchangeInitiationV02"
definition="The KeyExchangeInitiation message can be initiated by any party and received by any party (acquirer, agent or issuer). This message is used to initiate a cryptographic key activity (request of a key change, request of the verification of a key, etc.).


"
registrationStatus="Registered"
messageSet="_oFVkcKmaEeqA4rV5xCgycA"
xmlTag="KeyXchgInitn"
rootElement="Document"
xmlns:xmi="http://www.omg.org/XMI">
<messageBuildingBlock
xmi:id="_2CqhVlWVEeeiG_nL4vgKnQ"
nextVersions="_oOlvs4v6EeumSPwlS1PkxQ"
name="Header"
definition="Information related to the management of the protocol."
registrationStatus="Provisionally Registered"
maxOccurs="1"
minOccurs="1"
xmlTag="Hdr"
complexType="_q9fuQVWWEeeiG_nL4vgKnQ" />
<messageBuildingBlock
xmi:id="_2CqhWVWVEeeiG_nL4vgKnQ"
nextVersions="_oOlvtYv6EeumSPwlS1PkxQ"
name="Body"
definition="Information related to a key exchange activity."
registrationStatus="Provisionally Registered"
maxOccurs="1"
minOccurs="1"
xmlTag="Body"
complexType="_J7mlMVWXEeeiG_nL4vgKnQ" />
<messageBuildingBlock
xmi:id="_2CqhWFWVEeeiG_nL4vgKnQ"
nextVersions="_oOlvt4v6EeumSPwlS1PkxQ"
name="SecurityTrailer"
definition="Trailer of the message containing a MAC"
registrationStatus="Provisionally Registered"
maxOccurs="1"
minOccurs="0"
xmlTag="SctyTrlr"
complexType="_fP-osaQuEeeWXKXf3KjtmQ" />
<messageDefinitionIdentifier
businessArea="canm"
messageFunctionality="003"
flavour="001"
version="02" />
</messageDefinition>
ISO Building Blocks
The following items are used as building blocks to construct this message.