summaryrefslogtreecommitdiffstats
path: root/misc/uicBarcodeHeader_v2.0.0.asn
blob: 55915d07dabb7b96313bc6c47e1fa11d26dd37e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
-- Author: ClemensGantert
-- Created: Thu Jun 04 17:19:28 CEST 2020
ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN

-- imports and exports
-- EXPORTS ALL;

	
-- ##############################################################################################
-- #	                                                                      
-- #   UIC barcode header - version 2.0.0
-- #
-- ##############################################################################################


-- ##############################################################################################
-- #                                                                      
-- #  Naming and encoding conventions        
-- # 
-- # -	A bar code which is only static (printed on a paper), and for which the security is in the system, 
-- #      does not need any of these elements.
-- # -	A bar code which is only static, and includes its own security, needs:
-- #  	  level1Signature
-- #      level1KeyAlg if the associated key does not include the complete certificate in keys.xml but only the public key
-- #	  (but level1SigningAlg is not necessary as it is in keys.xml)
-- # -	A dynamic bar code including static and dynamic signatures needs:
-- #	The same elements as a static bar code above,
-- #	level2SigningAlg, level2keyAlg, level2PublicKey, and level2Signature.
-- #
-- # Changes to Version 1:
-- #
-- #   - endOfValidity added in Level1Data
-- #   - extension option added on all structures  
-- #
-- #########################################################################################	
	
	
-- ############################################################################################
	

-- type assignments

    -- #########################################################################################
    -- the basic entry point of the data structure 
    -- ##########################################################################################
    UicBarcodeHeader 	::= SEQUENCE 	{ 	
    	-- barcode format type
    	format		            IA5String,	 		
    	                        -- "U2" = UIC ticket 
                
                   
    	level2SignedData 	    Level2DataType,                

    	-- signature is calculated on the PER unaligned encoding of level2 signature data
    	level2Signature         OCTET STRING OPTIONAL
   }
   
   Level2DataType	::= SEQUENCE {
   
       	  level1Data	         Level1DataType,
       	  
       	  -- signature is calculated on the PER unaligned encoding of level1 signature data
       	  level1Signature        OCTET STRING OPTIONAL,
       	
       	  level2Data             DataType OPTIONAL

   }
   
   
   Level1DataType	::= SEQUENCE {
   
    	-- provider of the level1 signature  (RICS code)
    	securityProviderNum INTEGER (1..32000) OPTIONAL,				
    	securityProviderIA5 IA5String          OPTIONAL,	
    	
    	keyId		        INTEGER(0..99999)  OPTIONAL,
    	
    	dataSequence 	    SEQUENCE OF DataType,


      	-- object identifier of the key algorithms
      	--   e.g. 
      	--    ECC P-256     1.2.840.10045.3.1.7             
      	level1KeyAlg        OBJECT IDENTIFIER OPTIONAL,
      	level2KeyAlg        OBJECT IDENTIFIER OPTIONAL,

      	-- object identifier of the signing algorithm
      	--   e.g. 
      	--    DSA SHA224  2.16.840.1.101.3.4.3.1
      	--    DSA SHA256  2.16.840.1.101.3.4.3.2
      	--    ECDSA-256   1.2.840.10045.4.3.2
      	-- algorithm used for signing
      	level1SigningAlg   OBJECT IDENTIFIER OPTIONAL,
      	level2SigningAlg   OBJECT IDENTIFIER OPTIONAL,
        level2PublicKey    OCTET  STRING     OPTIONAL,
        
        -- end of the validity of the bar code, after this date and time the bar code needs to be regenerated 
        -- by the provider of the ticket
        -- if end of validity is provided year day and time must be provided.
        -- year, day, time are in UTC
        -- the provider of the bar code should ensure that the endOfValidity given here does not exceed 
        --     the validity of the key pair used on level 2.
   		endOfValidityYear 		INTEGER (2016..2269) OPTIONAL,    	
   		-- number of the day in the year (1.1. = 1)
   		endOfValidityDay		INTEGER (1..366) OPTIONAL, 
   		-- The number of the minutes of the day 
   		endOfValidityTime		INTEGER (0..1439) OPTIONAL,
   		
   		-- validity duration in seconds of the bar code shown with reference to the time stamp  dynamicContentTimeStamp 
   		--          in the dynamic data included in the level2Data
   		validityDuration        INTEGER (1..3600) OPTIONAL
   }

   DataType ::= SEQUENCE {
    	
        -- The value of 'dataFormat' describes how 'data' is encoded:
        -- "FCBn" means that 'data' is the Canonical Unaligned PER encoding 
        --    of an ASN.1 element of type UicRailTicketData in major version n.
        -- "FDCn" means that 'data' is the Canonical Unaligned PER encoding 
        --    of an ASN.1 element of type UicDynamicContentData in major version n.
        -- "+" + [2-letters ISO 3166 country code] + [addon, chosen by the standardization body of that country]
        --    means that 'data' is a content defined by the national standardization body,
        --    identified as 'addon' by this body.
        -- "_" + [4-digit RICS] + [addon, chosen by this company] means that 'data' is a proprietary
        --    content of the company identified by the RICS code, identified as 'addon' by this company.
        -- "*" + [addon] means that 'data' is a content specific to this barcode,
        --    with no further information on who defined it, identified as 'addon' by its issuer.
        -- Others values are reserved for future UIC use and shall not be used. 	
    	  	
       	dataFormat	    IA5String,      	
    	data	    	OCTET STRING
   }


END