2017-06-26 4 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の3つの関数があります。

誰でも手助けできますか?どうもありがとうございました。

+0

あなたの画像は私のためには機能しませんが、コードのスクリーンショットであれば、そのコードを削除して、代わりにコードに_ **をテキスト** _として入れてください。 –

+0

@VisualVincent、こんにちは、私はイメージを見ることができ、それは質問のテキストです。 – ccy

+0

@VisualVincent、それはコードのものではなく、そのフォーマット要件です。 – ccy

答えて

0

あなたが与えたことは、CA秘密鍵で署名された発行者公開鍵証明書を検証するために端末で利用できる最小限のデータです。端末には、カードからのデータと一致するCA公開鍵リスト(カードからのRIDと指数を使用)、正しいCA Pubic鍵を取得して証明書を開くことができます。しかし、あなたの要件は "CAの公開鍵をフォーマットして出力する"ということは私には意味がありません。 発行者公開鍵証明書の形式は次のとおりです。 HSM RACAL 9000

enter image description here

、証明書を生成するためのコマンドは、しかし、私が今までそれを使用していない、EWとなります。

注::上記はあなたの問題を理解したものです。私の理解があなたの要件を満たしていると思ったら、オフラインデータ認証について説明しているセクション全体を参照してください。それは非常に興味深いです。それ以外の場合は慎重に無視してください;)

+0

こんにちは、私の理解が正しいなら、私が与えられたフォーマットはCAの公開鍵です。私はあなたのグラフィックを知っています。これは署名のためにCAに送られる発行者の公開鍵です。しかし、ATMや他の端末にインストールする必要のあるCA公開鍵を出力する必要があります。 – ccy

+0

今、私はNcryptokiとCryptoAPIを使ってHSMを扱います。私はVB.net上でコーディングする必要があり、発行者公開鍵証明書とCA公開鍵の別のフォーマットのこのフォーマットが必要なHSMに伝えるためにコードを使用します。私の質問は、どのようにしてこの要求フォーマットをコーディングに書くことができるかです。ありがとう。 – ccy

+0

CAの公開鍵は、VisaやMastercardのようなCAから取得します。指定したテーブルは、カードのデータを照合して正しいCA公開鍵を選択するために、ODAで使用する端末に格納する必要のあるデータです。その表の上のほんの数行を少なくとも読んでください。より明確に与えられることはできません。あなたが投稿したものはフォーマットではなく、テーブル自体の名前は "Minimum set of .."です。 – adarsh