我正在尝试将小程序安装到 J3A040 JCOP 卡中。
作为安装方法,我有以下内容:
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 和 RSA CRT(1280 到 2048 位密钥)用于加密/解密以及签名生成和验证1 d。在安全环境中生成 RSA CRT 密钥(1280 到 2048 位密钥)
我想应该问题不大。
有什么猜测吗?