Fix Agent and CM Issues
[aaf/authz.git] / auth / auth-certman / src / main / java / org / onap / aaf / auth / cm / cert / CSRMeta.java
index f67f445..e0ee036 100644 (file)
@@ -9,9 +9,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -75,7 +75,8 @@ public class CSRMeta {
         if (name==null) {
             X500NameBuilder xnb = new X500NameBuilder();
             xnb.addRDN(BCStyle.CN,cn);
-            xnb.addRDN(BCStyle.E,email);
+            // Add as Subject Alternate Name, email
+            // xnb.addRDN(BCStyle.E,email);
             if (mechID!=null) {
                 if (environment==null) {
                     xnb.addRDN(BCStyle.OU,mechID);
@@ -90,15 +91,15 @@ public class CSRMeta {
         }
         return name;
     }
-    
-    
+
+
     public PKCS10CertificationRequest  generateCSR(Trans trans) throws IOException, CertException {
         PKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(x500Name(),keypair(trans).getPublic());
         if (challenge!=null) {
             DERPrintableString password = new DERPrintableString(challenge);
             builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_challengePassword, password);
         }
-        
+
         int plus = email==null?0:1;
         if (!sanList.isEmpty()) {
             GeneralName[] gna = new GeneralName[sanList.size()+plus];
@@ -107,7 +108,7 @@ public class CSRMeta {
                 gna[++i]=new GeneralName(GeneralName.dNSName,s);
             }
             gna[++i]=new GeneralName(GeneralName.rfc822Name,email);
-            
+
             builder.addAttribute(
                     PKCSObjectIdentifiers.pkcs_9_at_extensionRequest,
                     new Extensions(new Extension[] {
@@ -122,7 +123,7 @@ public class CSRMeta {
             throw new CertException(e);
         }
     }
-    
+
     @SuppressWarnings("deprecation")
     public static void dump(PKCS10CertificationRequest csr) {
          Attribute[] certAttributes = csr.getAttributes();
@@ -152,7 +153,7 @@ public class CSRMeta {
                  }
          }
     }
-    
+
     public X509Certificate initialConversationCert(Trans trans) throws CertificateException, OperatorCreationException {
         GregorianCalendar gc = new GregorianCalendar();
         Date start = gc.getTime();
@@ -209,15 +210,15 @@ public class CSRMeta {
     public void environment(String env) {
         environment = env;
     }
-    
+
     /**
-     * 
+     *
      * @return
      */
     public String environment() {
         return environment;
     }
-    
+
     /**
      * @return the mechID
      */
@@ -263,5 +264,5 @@ public class CSRMeta {
     public void challenge(String challenge) {
         this.challenge = challenge;
     }
-    
+
 }