Commit e1ebc695 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added ASN.1 types library

parent dbf6b5d1
Loading
Loading
Loading
Loading
+95 −0
Original line number Diff line number Diff line
Note: "Based on TR 103 119 v1.4.1"
@Version: "1.0.0"
Package ASN1 {
	Import all from TDL

    //Constraints
        //Specific typed constraints for each type
        //Constraint AsnBitString
        //Constraint AsnOctetString
        //Constraint AsnUtcString
    //or
        //Generic constraint with corresponding detail in
        //the constraint quantifier/qualifier: 
        //e.g. "[01]+'B" or more generically "AsnBitString"?   
        Constraint ASN1String
        Constraint ASN1DateTime
        Constraint ASN1Real
        Constraint ASN1ObjectIdentifier
    
    //Types
        //BITSTRING
            Type BITSTRING {ASN1String:"[01]+'B"}
            //or 
            //Type BITSTRING {ASN1String:"AsnBitString"}
            //or
            //Type BITSTRING {AsnBitString}
    
        //OCTETSTRING
            Type OCTETSTRING {ASN1String:"[A-F0-9]+'H"}
            //or
            //Type OCTETSTRING {AsnOctetString}
            //or 
            //Type OCTETSTRING {ASN1String:"AsnOctetString"}
   
	    //BMPString
	    	Type BMPString {ASN1String}
	    //IA5String
	    	Type IA5String {ASN1String}
	    //GeneralString
	    	Type GeneralString {ASN1String}
	    //GraphicString
	    	Type GraphicString {ASN1String}
	    //NumericString
	    	Type NumericString {ASN1String: "[0-9\\s]+"}
	    //PrintableString
	    	Type PrintableString {ASN1String}
	    //TeletexString
	    	Type TeletexString {ASN1String}
	    //T61String
	    	Type T61String {ASN1String}
	    //UniversalString
	    	Type UniversalString {ASN1String}
	    //UTF8String
	    	Type UTF8String {ASN1String}
	    //VideotexString
	    	Type VideotexString {ASN1String}
	    //VisibleString
	    	Type VisibleString {ASN1String}

        //UTCTime
            Type UTCTime {ASN1DateTime:"YYMMDDhhmm[ss]Z"}
            //Type UTCTime {ASN1String:"YYMMDDhhmm[ss]Z"}
            //or 
            //Type UTCTime {ASN1String:"AsnOctetString"}    
            //or
            //Type UTCTime {ASN1DateTime:"AsnOctetString"}    
            //or 
            //Type UTCTime {AsnUtcString}
    
	    //GeneralizedTime
	    	Type GeneralizedTime {ASN1DateTime:"YYYYMMDDHH[MM[SS[.fff]]]Z"}
	    //DATE
	    	Type DATE {ASN1DateTime:"YYYY-MM-DD"}
	    //TIME-OF-DAY
	    	Type TimeOfDay {ASN1DateTime:"hh:mm:ss"}
	    //DATE-TIME
	    	Type DateTime {ASN1DateTime:"YYYY-MM-DDThh:mm:ss"}
	    //INTEGER
	    	//already defined in TDL -> use that
	    	//Type Integer
	    //REAL
	    	//originally mapped to string with constraint, would override standard
	    	Type Real {ASN1Real}
	    //BOOLEAN
	    	//already defined in TDL -> use that
	    	//Type Integer
	    //NULL
	    	Type Null
	    //OBJECTIDENTIFIER 
	    	Type ObjectIdentifier {ASN1ObjectIdentifier}

	    //RELATIVE OBJECT OBJECTIDENTIFIER 
	    	//use ObjectIdentifier above
	
}
 No newline at end of file