/**
  * Set the subject distinguished name. The subject describes the entity associated with the public
  * key.
  */
 public void setSubjectDN(X500Principal subject) {
   try {
     tbsGen.setSubject(new X509Principal(subject.getEncoded()));
   } catch (IOException e) {
     throw new IllegalArgumentException("can't process principal: " + e);
   }
 }
 /**
  * Set the subject distinguished name. The subject describes the entity associated with the public
  * key.
  */
 public void setSubjectDN(X509Name subject) {
   tbsGen.setSubject(subject);
 }