createJKS, loadkeys, savekeys, reusecertificate, endEntityProfileId);
if (tokentype == SecConst.TOKEN_SOFT_PEM) {
buf = KeyTools.getSinglePemFromKeyStore(ks, submessage.getPassword().toCharArray());
} else if (tokentype == SecConst.TOKEN_SOFT_P12 || tokentype == SecConst.TOKEN_SOFT_JKS) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ks.store(baos, submessage.getPassword().toCharArray());
buf = baos.toByteArray();
} else {
return new KeyStoreRetrievalResponse(submessage.getRequestId(), false, "Unknown token type.", null, null);
}
return new KeyStoreRetrievalResponse(submessage.getRequestId(), true, null, tokentype, buf);