我的问题是我正在使用带有令牌的以下 IAIK 版本
- 提供者:1.5
- 包装:1.4
- JCE:5.25
- Safenet PKCS11 驱动程序:10.2
现在我想使用最新版本:
- 提供者:1.6.2
- 包装:1.7
- JCE:5.62
- Safenet PKCS11 驱动程序:10.8 R2
最大的问题是我无法再读取数据对象,即使
session.findObjectsInit(null);
对于旧版本,使用以下模板我可以获得数据对象:
private static GenericTemplate getTokenObjectTemplate3(String label) {
Preconditions.checkArgument(label != null);
GenericTemplate template = new GenericTemplate();
LongAttribute objectClassAttribute = new LongAttribute(PKCS11Constants.CKA_CLASS);
objectClassAttribute.setLongValue(new Long(PKCS11Constants.CKO_DATA));
template.addAttribute(objectClassAttribute);
CharArrayAttribute labelAttribute = new CharArrayAttribute(PKCS11Constants.CKA_LABEL);
labelAttribute.setCharArrayValue("oostatus".toCharArray());
template.addAttribute(labelAttribute);
BooleanAttribute tokenAttribute = new BooleanAttribute(PKCS11Constants.CKA_TOKEN);
tokenAttribute.setBooleanValue(Boolean.TRUE);
template.addAttribute(tokenAttribute);
BooleanAttribute privateAttribute = new BooleanAttribute(PKCS11Constants.CKA_PRIVATE);
privateAttribute.setBooleanValue(Boolean.FALSE);
template.addAttribute(privateAttribute);
CharArrayAttribute applicationAttribute = new CharArrayAttribute(PKCS11Constants.CKA_APPLICATION);
applicationAttribute.setCharArrayValue(TOKEN_APPLICATION.toCharArray());
template.addAttribute(applicationAttribute);
return template;
}
现在我正在使用以下内容但徒劳无功:
private static Data getTokenObjectTemplate4() {
Data dataObjectTemplate = new Data();
dataObjectTemplate.getLabel().setCharArrayValue(TOKEN_STATUS_LABEL.toCharArray());
return dataObjectTemplate;
}
请问运行代码有什么帮助或和平吗?