Message ASN.1


ECoinASN1Module DEFINITIONS EXPLICIT TAGS ::= BEGIN
-- imports and exports

EXPORTS ALL;
IMPORTS Certificate

    FROM AuthenticationFramework {joint-iso-itu-t ds(5) module(1) 
    
                                    authenticationFramework(7) 6}  
-- type assignments

MessagePacket ::= [APPLICATION 0] SEQUENCE {

        version			        [0] ENUMERATED {v1(1),v2(2)} DEFAULT v1,          
        annotation			    [1] IA5String OPTIONAL,
        packet		 	        [2] EXPLICIT CHOICE {	
        
                auth-req		[0]	        AuthenticationRequest,
                vm-req		    [1]	        ValueMessageRequest,
                auth-resp		[10]        AuthenticationResponse,
                vm-resp		    [11]        ValueMessageResponse
	}
}

ValueMessageRequest ::= SEQUENCE {
           payee-id		           AssetStoreIdentifier,	
           currency		           CurrencyCode,
              value		           Value,
       include-cert		           BOOLEAN,
       response-url 		       IA5String,
          Challenge 		       [0] IMPLICIT Challenge OPTIONAL	
}

ValueMessageResponse ::= SEQUENCE {

        value-message 	ValueMessage
        payer-cert		[0] IMPLICIT Certificate OPTIONAL -- imported TYPE
        
}

AuthenticationRequest ::= SEQUENCE {
        requestor-id		    AssetStoreIdentifier,
        challenge				Challenge,
        response-url 			IA5String
}

AuthenticationResponse ::= SEQUENCE {
        zero-value-message		ValueMessage,
        cert					[0] IMPLICIT Certificate OPTIONAL
}

ValueMessage ::= SEQUENCE {
        secure-element-version	 	OCTET STRING(SIZE(1)),
        payer-id				 AssetStoreIdentifier ,
        payee-id				 AssetStoreIdentifier ,
        currency	 			 CurrencyCode ,
        value					 Value , 
        challenge		 		 Challenge ,
        datetime				 DateTime,
        tac 					 OCTET STRING(SIZE(24)) ,
        signature				 OCTET STRING (SIZE(128))
        
	-- Pending Issue: Signature is currently on raw concatenated 
    
    -- value-message fields before DER encoding.
}

AssetStoreIdentifier ::= OCTET STRING (SIZE(8))
DateTime ::= OCTET STRING(SIZE(3))
Challenge ::= OCTET STRING(SIZE(4))
Value ::= OCTET STRING (SIZE(3))
CurrencyCode ::= OCTET STRING (SIZE(1))

END