首页 | 新闻资讯 | 培训认证 | 安全管理 | 病毒分析 | 安全协议 | 网络安全 | 防火墙 | 黑客技术
DB安全 | Web安全 | 入侵检测 | 安全审计 | 设备安全 | 备份恢复 | 安全标准 | 法律法规 | 无线安全
OS安全 | PKI与PMI | 病毒防治 | 隔离网闸 | XML安全 | 网管专区 | 经典案例 | 技术论坛 |  
+ 文章搜索 +
当前位置:首页>>PKI与PMI>>ANS.1编码>>正文
关键字:
范 围:
※推荐文章※
·ASN.1 encoding rules
·ASN.1 developments
·A Layman's Guide to a Subset o
·ASN.1简介(4)
·ASN.1简介(3)
·ASN.1简介(2)
Developing ASN.1 Applications
作者: 文章出处:http://www.oss.com 发布时间:2005-06-25 点击:

Developing ASN.1 Applications is a simple 4-stage process.

Stage 1 - Specification Development

Stage 2 - Syntax Check and Compile

Stage 3 - Writing your Application

Stage 4 - Putting your Application to use

Stage 1:

Specification Development

In the first stage, application designers have to decide on the types of messages that the final application(s) will need to send/exchange. Based on the message requirements, a new ASN.1 specification can be drafted or an existing one can be used.

When drafting new ASN.1 specifications, it is helpful to decide on the encoding rules (e.g., BER, DER, and PER) which will be used in sending messages. Doing so will allow the final application to take full advantage of allowed efficiencies in the various encoding rules (such as ASN.1 subtype constraints leading to smaller encodings when using PER).

Drafters of ASN.1 specifications should also keep possible future requirements in mind (such as message extensibility and a change in the encoding rules used).

Example:

The below abstract syntax is designed to carry simple control and status messages between some electric machinery and a remote operator. The machine has two states: on and off . The operator can give the machine a turn on instruction, a turn off instruction, or a no action instruction.

ASN.1 Specification:

Stage 2:

Syntax Check & Compile

Most ASN.1 specifications are much more complicated than our previous simple example. Such specifications, when being drafted, often contain typographical and other syntax errors which need to be corrected. Finding and correcting such errors in long and complex ASN.1 specification manually can be an arduous task. Quality ASN.1 compilers (such as the ones offered by OSS Nokalva) can pinpoint such errors allowing the application developer to quickly resolve them.

Once such errors are fixed, the ASN.1 specification can be fed again into the ASN.1 compiler to produce data structures and related code for inclusion into the user's application program. The target language in which the data structures and code are produced varies according to the capabilities of the ASN.1 compiler in use. For example, OSS Nokalva offers separate ASN.1 compilers that use C, C++, Java, Pascal, or Cobol as their target language.

Stage 3:

Writing Your Application

In your application code, you can use the data structures produced by the ASN.1 compiler much in the same way as you would use data structures written by you. Additionally, you can use vendor provided runtime library functions (e.g., the OSS-provided ossEncode() and ossDecode() functions) to encode, decode, and perform various other functions on application data. You will find that using such pre-prepared library functions will both cut down on the time needed to develop your application and increase its final reliability and correctness.

Aids such as the OSS ASN.1 Tools allow you to develop ASN.1 applications for a large variety of platforms and embedded systems. So, the possibilities and ease of application development are even further extended.

Stage 4:

Putting Your Application to Use

Once your application is debugged and tested, you can put it into use to send and receive ASN.1 encoded messages. The diagram below illustrates a message exchange between the embedded chip controller and remote computer operator applications mentioned in the example in Stage 1.

For a more detailed example of how the OSS ASN.1 Tools work, see Building an Application .

返回顶部↑】 【推荐好友】 【查看评论
用户名: 新注册) 密码: 匿名评论 [查看评论] 发表评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  Copyright © 2004-2005 infosecurity.org.cn . All Rights Reserved
版权所有:中国信息安全组织 系统管理:webmaster@infosecurity.net.cn
本站部分资源来自互联网,如有侵犯您的版权或其他问题,请通知管理员,我们会尽快处理!