[英]Instantianting a SunPKCS11 with a config from a ByteArrayInputStream
我想實現這個:
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());
一起使用
奇怪的是,我只是委屈了字符串......
RSSS....
下面的"name = {0} \r\nlibrary = {1} \r\nslotListIndex = 0"
,就像一個魅力......愚蠢的我,我誤認為換行符並忘記了回車符......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.