if (names[i].getName() instanceof X509Name)
try
    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 X509Principal(((X509Name)names[i].getName()).getEncoded()));                    }                    catch (IOException e)                    {                        throw new RuntimeException("badly formed Name object");                    }                }            }                        return l.toArray(new Object[l.size()]);        }