ASN.1 module description

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 03:43:48

问题


I tried to use ASN.1 for a client server communication, but i'm not sure that i understand it correctly . The Client have to send an integer to the server, the server read it and send back a number and a String, the Client read them and send back a String the server read it and send back a String. It's something like this.

Client ---> server 1 integer

Server --> Client 1 integer
Server --> Client 1 String

Client ---> server 1 String
Server --> Client 1 String

I wrote the following ASN.1 module, I succeeded to generate the classes with jac asn1 but I am not sure that the description of the module are correct because the two sequence are exactly the same. I m not sure if i have to put only the variable that i will send or recive or both.

Demo-module DEFINITIONS ::=       -- Module-name DEFINITIONS ::= BEGIN

BEGIN

Client ::= SEQUENCE {

clientInt INTEGER ,

serverInt INTEGER ,

serverString BIT STRING ,

clientString BIT STRING , serverResponse BIT STRING

}

Server ::= SEQUENCE {

clientInt     INTEGER ,                 

serverInt INTEGER ,

serverString BIT STRING ,

clientString BIT STRING , serverResponse BIT STRING

}

END -- end of module, END required

来源:https://stackoverflow.com/questions/16497292/asn-1-module-description

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!