JAXBElement<RegisterRequestType> registerRequest2 = (JAXBElement<RegisterRequestType>) unmarshaller.unmarshal(bais);
registerRequestType = registerRequest2.getValue();
RSAKeyValueType rSAKeyValueType = (RSAKeyValueType) ((JAXBElement) registerRequestType.getPrototypeKeyBinding().getKeyInfo().getContent().get(0)).getValue();
RSAPublicKeySpec rSAPublicKeySpec = new RSAPublicKeySpec(new BigInteger(rSAKeyValueType.getModulus()), new BigInteger(rSAKeyValueType.getExponent()));
RSAPublicKey rSAPublicKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(rSAPublicKeySpec);
X509Certificate cert = CertTools.genSelfCert("CN=test", 10, null,keys.getPrivate(), rSAPublicKey, "SHA1WithRSA", true);
cert.verify(rSAPublicKey);