ENUMERATED
type in ASN.1 can be converted to enum
directly in protobuf.
For example,
Fuel ::= ENUMERATED {
solid(0),
liquid(1),
gas(2),
hybrid(3)
}
to
enum Fuel {
solid = 0;
liquid = 1;
gas = 2;
hybrid = 3;
}
CHOICE OF
type in ASN.1 can be converted to oneof
in protobuf
For example
speed CHOICE {
mph INTEGER,
kmph INTEGER
},
to
oneof speed {
int32 mph = 4;
int32 kmph = 5;
}
SEQUENCE
type in ASN.1 can be mapped to message
in protobuf
RepeatedExample ::= SEQUENCE {
repeated_field SEQUENCE OF INTEGER
}
message RepeatedExample {
repeated int32 repeated_field = 1;
}
SEQUENCE OF
type in ASN.1 to repeated
in protobuf
RepeatedExample ::= SEQUENCE {
repeated_field SEQUENCE OF INTEGER
}
message RepeatedExample {
repeated int32 repeated_field = 1;
}
SEQUENCE OF SEQUENCE
type in ASN.1 can be mapped to map
in protobuf
MapExample ::= SEQUENCE {
my_map SEQUENCE OF SEQUENCE {
key INTEGER,
value UTF8String
}
}
message MapExample {
map<int32, string> my_map = 4;
}