tokenUser1.setCertificateProfileName("ENDUSER");
KeyPair basickeys = KeyTools.genKeys("1024", AlgorithmConstants.KEYALGORITHM_RSA);
PKCS10CertificationRequest basicpkcs10 = new PKCS10CertificationRequest("SHA1WithRSA", CertTools.stringToBcX509Name("CN=NOTUSED"), basickeys
.getPublic(), new DERSet(), basickeys.getPrivate());
ArrayList<TokenCertificateRequestWS> requests = new ArrayList<TokenCertificateRequestWS>();
TokenCertificateRequestWS tokenCertReqWS = new TokenCertificateRequestWS();
tokenCertReqWS.setCAName(caName);
tokenCertReqWS.setCertificateProfileName("WSTESTPROFILE");
tokenCertReqWS.setValidityIdDays("1");
tokenCertReqWS.setPkcs10Data(basicpkcs10.getDEREncoded());
tokenCertReqWS.setType(HardTokenConstants.REQUESTTYPE_PKCS10_REQUEST);
requests.add(tokenCertReqWS);
tokenCertReqWS = new TokenCertificateRequestWS();
tokenCertReqWS.setCAName(caName);
tokenCertReqWS.setCertificateProfileName("ENDUSER");
tokenCertReqWS.setKeyalg("RSA");
tokenCertReqWS.setKeyspec("1024");
tokenCertReqWS.setType(HardTokenConstants.REQUESTTYPE_KEYSTORE_REQUEST);
requests.add(tokenCertReqWS);
HardTokenDataWS hardTokenDataWS = new HardTokenDataWS();
hardTokenDataWS.setLabel(HardTokenConstants.LABEL_PROJECTCARD);
hardTokenDataWS.setTokenType(HardTokenConstants.TOKENTYPE_SWEDISHEID);
hardTokenDataWS.setHardTokenSN(serialNumber);