我正在嘗試將一個小程序安裝到J3A040 JCOP卡中。安裝Java卡小程序因RSA密鑰對生成而失敗
由於安裝方法我有以下幾點:
protected MainApplet() {
try {
// CREATE RSA KEYS AND PAIR
m_keyPair = new KeyPair(KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_2048);
// STARTS ON-CARD KEY GENERATION PROCESS
m_keyPair.genKeyPair();
// OBTAIN KEY REFERENCES
m_publicKey = (RSAPublicKey) m_keyPair.getPublic();
m_privateKey = (RSAPrivateKey) m_keyPair.getPrivate();
} catch (CryptoException c) {
//this line will give you the reason of problem
short reason = c.getReason();
ISOException.throwIt(reason); // for check
}
register();
}
安裝總是失敗,出現以下錯誤:
pro.javacard.gp.GPException: Install for Install and make selectable failed SW: 6A80
at pro.javacard.gp.GlobalPlatform.check(GlobalPlatform.java:1092)
at pro.javacard.gp.GlobalPlatform.installAndMakeSelectable(GlobalPlatform.java:798)
at pro.javacard.gp.GPTool.main(GPTool.java:478)
但是,如果我刪除密鑰對生成,一切工作正常。 我已閱讀卡的規格和它所代表:
. RSA and RSA CRT (1280 up to 2048 bits keys) for en-/decryption and signature generation and verification1 d. RSA CRT key generation (1280 up to 2048 bits keys) in a secured environment
我想這不應該是一個問題。
任何猜測?
哦,尷尬..你肯定是正確的。謝謝 – 2015-04-02 18:23:00