在 64 位机器上访问硬件 PKCS11 令牌 [英] Accessing Hardware PKCS11 Token on a 64 Bit Machine

查看:24
本文介绍了在 64 位机器上访问硬件 PKCS11 令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这就是我想要做的.我有一个带有一些证书的硬件令牌,我正在编写一个 Java 应用程序来尝试访问这些证书.我已经将 jre6 中的 SunPKCS11 库用于 Windows 32 位机器.这是我如何访问证书的一个小示例:

So here's what I'm trying to do. I have a hardware token with some certs on it and I'm writing a Java application to try and access those certs. I have used the SunPKCS11 library in jre6 for a windows 32 bit machine. This is a small sample of how I access the certs:

String configName = "pkcs.cnf"
String PIN = "123456";
Provider p = new sun.security.pkcs11.SunPKCS11(configName);
Security.addProvider(p);
KeyStore keyStore = KeyStore.getInstance("PKCS11");
char[] pin = PIN.toCharArray();
keyStore.load(null, pin);

效果很好,我可以获得证书和所有东西.现在我试图在 64 位机器上做同样的事情.但是我正在尝试使用 64 位 jre6 库并且缺少 SunPKCS11 jar 文件 (位于 {java.home}/lib/ext.因此我无法创建 SunPKCS11 对象.我的你的问题是,我现在该怎么办?如何使用 64 位 java 库访问令牌上的证书?有人为这样的任务编写了 64 位包装器吗?

It works great, I'm able to get the certs and everything. Now I'm trying to do the same on a 64 bit machine. However I am trying to use the 64 bit jre6 library and that is missing the SunPKCS11 jar file (located in {java.home}/lib/ext. Because of that I cannot create a SunPKCS11 object. My question to you is, what do I do now? How can I access the certs on a token using 64 bit java libraries? Has someone written a 64 bit wrapper for such a task?

推荐答案

PKCS11 支持未实现,因为无法测试该库(不知何故,无论如何).

PKCS11 Support was not implemented because there was no way to test that library (somehow, whatever).

不过,这在 Java 8 中发生了变化.由于 J8b49 包括 64 位版本.看:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6880559

This has changed in Java 8, though. Since J8b49 a 64 bit Version is included. See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6880559

这篇关于在 64 位机器上访问硬件 PKCS11 令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆