PKI中常用编码:ASN.1 DER BER Base64

    迟到了两年的笔记...

    在PKI的应用中,常会用到以下几个编码概念:

   

    ASN.1(Abstract Syntax Notation One, 抽象语法标记)

    定义:A standard interface description language for defining data structures that can be serialized and deserialized in a cross-platform way.

    理解:一种用于描述事物或对象的方式,描述了对象的属性。例如:

             桌子 :: = SEQUENCE {

                   形状:方形

                   颜色:红色

                   材质:原木 

            }

 

    BER/DER(Basic Encoding Rules/Distinguished Encoding Rules)

    用ASN.1 数据结构描述对象,比较容易被人所理解,但是不利于计算机识别。在实际应用中,为了在计算机中运算解析,需要将ASN.1结构体以二进制形式表现。BER编码规定了二进制表示ASN.1数据结构的规则,DER是BER中的一种。

 

    Base64编码

    定义:Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation.

    理解:使用64个可见字符表示二进制数据的编码方法。

 

 

参考:

https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One

https://en.wikipedia.org/wiki/X.690#BER_encoding

https://en.wikipedia.org/wiki/X.690#DER_encoding

https://en.wikipedia.org/wiki/Base64

posted @ 2018-12-11 22:11  !--!  阅读(1065)  评论(0编辑  收藏  举报