private DERObject getEncodedX509Certificate( X509Certificate cert )
throws CertificateEncodingException
{
try {
ByteArrayInputStream inStream = new ByteArrayInputStream( cert.getEncoded() );
DERInputStream derInStream = new DERInputStream( inStream );
return derInStream.readObject();
} catch ( IOException ex ) {
throw new CertificateEncodingException( "IOException caught while encoding certificate\n" + ex.toString() );
}
}