Merge branch 'master' of github.com:wso2/carbon-device-mgt

4.x.x
Kasun Delgolla 9 years ago
commit efa90b244f

@ -58,7 +58,7 @@
org.apache.commons.logging,
javax.security.auth.x500,
javax.xml.parsers,
org.apache.commons.codec.binary,
org.apache.commons.codec.binary;version="${version.commons.codec}",
org.bouncycastle.asn1,
org.bouncycastle.asn1.x500,
org.bouncycastle.asn1.x509,

@ -348,19 +348,19 @@ public class CertificateGenerator {
Date validityBeginDate = commonUtil.getValidityStartDate();
Date validityEndDate = commonUtil.getValidityEndDate();
X500Name certSubject = request.getSubject();
X500Name certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL);
Attribute attributes[] = request.getAttributes();
if (certSubject == null) {
certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL);
} else {
org.bouncycastle.asn1.x500.RDN[] rdn = certSubject.getRDNs();
if (rdn == null || rdn.length == 0) {
certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL);
}
}
// if (certSubject == null) {
// certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL);
// } else {
// org.bouncycastle.asn1.x500.RDN[] rdn = certSubject.getRDNs();
//
// if (rdn == null || rdn.length == 0) {
// certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL);
// }
// }
X509v3CertificateBuilder certificateBuilder = new X509v3CertificateBuilder(
new X500Name(issueSubject), CommonUtil.generateSerialNumber(),
validityBeginDate, validityEndDate, certSubject, request.getSubjectPublicKeyInfo());

Loading…
Cancel
Save