格式化公钥

时间:2017-06-26 16:27:00

标签: vb.net emv

我正在使用HSM签署证书,我需要格式化CA公钥并输出它。我阅读了EMV Book和格式如下:

Field Name                      Length                   Description                       Format 

Registered 
Application Provider              5                Identifies the payment system to           b 
Identifier (RID)                                   which the  Certification Authority 
                                                   Public Key is associated 


Certification                                      
Authority Public Key              1                Identifies the Certification 
Index                                              Authority Public Key in                    b 
                                                   conjunction with the RID



Certification 
Authority Hash                    1                Identifies the hash algorithm used         b
Algorithm Indicator                                to produce the Hash Result in the 
                                                   digital signature scheme 



Certification 
Authority Public Key              1                Identifies the digital signature 
Algorithm Indicator                                algorithm to be used with the              b 
                                                   Certification Authority Public Key 



Certification 
Authority Public Key             Var.              Value of the modulus part of the           b 
Modulus                          (max              Certification Authority Public Key 
                                 248)



Certification 
Authority Public Key             1 or 3            Value of the exponent part of the          b 
Exponent                                           Certification Authority Public Key, 
                                                   equal to 3 or 216 + 1



Certification 
Authority Public Key             20                A check value calculated on the            b
Check Sum36                                        concatenation of all parts of the 
                                                   Certification Authority Public Key 
                                                   (RID, Certification Authority 
                                                   Public Key Index, Certification 
                                                   Authority Public Key Modulus,   
                                                   Certification Authority Public Key 
                                                   Exponent) using SHA-1 

我正在用Visual Basic.net编写代码。如何在代码和输出中格式化?我创建了一个名为PublicKey的类,它有三个函数,ExportPublicKey,FormatPublicKey和WritePublicKeyToFile。

有人可以帮忙吗?非常感谢你。

1 个答案:

答案 0 :(得分:0)

您所提供的是在终端中可用于验证由CA私钥签名的颁发者公钥证书的最低要求数据。在终端上,您将拥有CA公钥列表,您将与卡中的数据匹配(使用RID和卡中的指数),获取正确的CA Pubic密钥并打开证书。但是您的要求"格式化CA公钥并输出它"对我毫无意义。 发卡行公钥证书的格式如下。

enter image description here

在HSM Racal 9000上,生成证书的命令将是EW,但我从未使用它。

注意:以上是基于我对您的问题的理解。如果您认为我的理解符合您的要求,请查看有关离线数据身份验证的整个部分。这很有趣。否则轻轻地忽略;)