我想要实现这一点:
private static InputStream getTokenCfg() {
String cfg = MessageFormat.format(
"name = {0} /n library = {1} /n slotListIndex = 0",
config.getPkcs11().getKey(),
config.getPkcs11().getValue());
return new ByteArrayInputStream(cfg.getBytes());
}然后在new SunPKCS11(getTokenCfg());中使用它
发布于 2012-04-05 21:20:05
奇怪的是,我只是弄错了线。
rsss....
下面的"name = {0} \r\nlibrary = {1} \r\nslotListIndex = 0",工作起来就像一个护身符。我太傻了,我把换行符弄错了,忘记了回车字符...
https://stackoverflow.com/questions/10019103
复制相似问题