code: public static byte[] encodeDN(Codec codec, String distinguishedName) throws Exception {
          X500Principal issuer = new X500Principal(distinguishedName);
          X509CertSelector certSelector = new X509CertSelector();
          certSelector.setIssuer(issuer);
          byte[] asnX501DN = certSelector.getIssuerAsBytes();
  
          Any a = ORB.init().create_any();
          X501DistinguishedNameHelper.insert(a, asnX501DN);
          return codec.encode_value(a);
      }
docs: Encode a distinguished name into a codec encoded ASN.1 X501 encoded Distinguished Name.
  
  @param codec The codec to do the encoding of the Any.
  @param distinguishedName The distinguished name.
  @return the codec encoded ASN.1 X501 encoded Distinguished Name.
  @throws Exception