2017-06-26 47 views
0

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

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.How的代码,我可以在代码和输出格式呢?我创建了一个名为PublicKey的类,并且有三个函数,ExportPublicKey,FormatPublicKey和WritePublicKeyToFile。

任何人都可以帮忙吗?非常感谢你。

+0

您的图片对我而言不起作用,但如果这是代码截图,您应该将其删除,并将代码_ **替换为文本** _。 –

+0

@VisualVincent,嗨,我可以看到图像,它是问题中的文本。 – ccy

+0

@VisualVincent,它不是代码的东西,它的格式要求。 – ccy

回答

0

您曾经给过的是在终端可用的验证由CA私钥签署的颁发者公钥证书的最低要求数据。在终端上,您将拥有CA公钥列表,您将与卡上的数据匹配(使用RID和卡中的指数),获取正确的CA公钥并打开证书。但是您的要求“格式化CA公钥并输出”对我来说毫无意义。 颁发者公钥证书格式如下。

enter image description here

在一个HSM雷卡9000,生成证书的命令将EW,但是我还没有使用过它。

注意:以上是基于我对你的问题的理解。如果您认为我的理解符合您的要求,请阅读关于脱机数据身份验证的全部内容。这很有趣。否则轻轻忽略;)

+0

嗨,如果我的理解是正确的,我给出的格式是CA公钥。我知道你的图形,这是发送给CA的发行者公钥,用于签名。但是我需要输出需要在ATM或其他终端上安装的CA公钥。 – ccy

+0

,现在我用Ncryptoki和CryptoAPI来处理HSM。我需要在VB.net上编码,并使用代码告诉HSM我想要这种颁发者公钥证书格式和另一种CA公钥格式。我的问题是如何在编码中编写这种需求格式。谢谢。 – ccy

+0

CA公钥,您将从Visa和Mastercard等CA获得。您提供的表格是您需要存储在终端中的数据,以便在ODA期间通过匹配来自卡的数据选择正确的CA公钥。阅读该表格上方至少几行。它不能更清楚地给出。您发布的内容不是任何格式,表本身的名称是“Minimum set of ..” – adarsh