访问64位机器上的硬件PKCS11令牌 [英] Accessing Hardware PKCS11 Token on a 64 Bit Machine
问题描述
所以这里是我想做的。我有一个硬件令牌与一些证书上,我正在写一个Java应用程序,尝试和访问这些证书。我已经使用SunPKCS11库在jre6为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屋!