Code example for X500Principal

0
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
 
            aOut.writeObject(c.getIssuer());
 
            return new X500Principal(bOut.toByteArray());
        } 
        catch (IOException e)
        { 
            throw new IllegalStateException("can't encode issuer DN");
        } 
    } 
 
    public Principal getSubjectDN()
    { 
        return new X509Principal(c.getSubject());
    } 
 
    public X500Principal getSubjectX500Principal()
    { 
        try