+" Algorithm identifier: " + algorithmIdentifier
+" Issuer: " + issuerNm
+" Optional validity: " + optionalValidity
+" Subject: " + subject);
AsymmetricKeyParameter keyParam = PublicKeyFactory.createKey(subjectPublicKeyInfo);
// TODO: handle other types of keys.
if (keyParam instanceof RSAKeyParameters) {
RSAKeyParameters rsaKeyParam = (RSAKeyParameters) keyParam;
DefaultCertificate cert = new DefaultCertificate(this);
cert.setDefaultSerialisation(new DERSerialisation(cert));
cert.setSubjectPublicKey(new DefaultRSAPubKey(rsaKeyParam.getExponent(),rsaKeyParam.getModulus()));
return cert;
} else {
log.warn("KeyParam is not an RSA Key but of type"+keyParam.getClass()+" need to implement this.");
}
// A lot of potentially useful code developed by Bruno, that shows one one
// could use the extra fields in the CRMF structure.
// But use cases need to be found, and it really is not clear that any of this
// cannot be better done by passing the values in a form.