l.add(new X500Principal(((X509Name)names[i].getName()).getEncoded()));
l.add(new X500Principal(((ASN1Encodable)names[i].getName()).getEncoded()));
    private Object[] getNames(        GeneralName[] names)    {                List        l = new ArrayList(names.length);                for (int i = 0; i != names.length; i++)        {            if (names[i].getName() instanceof X509Name)            {                try                {                    l.add(new X500Principal(((X509Name)names[i].getName()).getEncoded()));                }                catch (IOException e)                {                    throw new RuntimeException("badly formed Name object");                }            }        }                return l.toArray(new Object[l.size()]);    }