PKCS10CertificationRequest pkcs10certreq = new PKCS10CertificationRequest(data);
if(!pkcs10certreq.verify()) {
throw new Exception("CSR verification failed.");
}
CertificationRequestInfo certReqInfo = pkcs10certreq.getCertificationRequestInfo();
Map map = new HashMap();
map.put(CERT_REQ_SUBJECT, certReqInfo.getSubject());
map.put(CERT_REQ_PUBLICKEY, certReqInfo.getSubjectPublicKeyInfo());
map.put(CERT_REQ_PUBLICKEY_OBJ, getPublicKeyObject(certReqInfo.getSubjectPublicKeyInfo()));
map.put(CERT_REQ_VERSION, certReqInfo.getVersion());
return map;
}