You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sanjeev Srivastava <sa...@yahoo.co.uk> on 2005/03/11 02:24:53 UTC

x509 Certificate Public key Problem - HELP

Hi all !

I am facing problem in displaying Public Key. When I
am pasring X509 certificate the Public Key is coming
as a very long String as as given in Format 1 below,
though it should come like as given in Format 2 below.


out.println(x509certificate.getPublicKey());

I am using Bouncy Castle API and after that only the
Public Key is coming like a long String. Please
advice. 


I tried to convert the Public key into byte array then
to String, but it is showing junk charaters. The
encoding for Publick key is ASN.1 DER but its is
giving error.

I need your advice .. Please HELP.......! 

byte buf [] =
x509certificate.getPublicKey().getEncoded();
String s = new String(buf, "UTF-8");
s= new String(s.getBytes("ISO8859_1"), "UTF-8");
out.println(s);


Format 1

RSA Public Key modulus:
cd288334541b89f30faf379131ffaf3160c9a8e8b21068ed9fe79336f10a64bb47f504173f23474dc5271981260c54720d882dd91f9a129fbcb371d380193f47667b8c3528d2b90adf24da9cd65079817a5ad337f7c24ad829922664d1e4986c3a008af5349b65f8ede310fffdb84958dca0de82396b81b1161961b954b6e643
public exponent: 3 


Format 2

SunJSSE RSA public key: public exponent: 010001
modulus: c90a4f87 1cb7a888 b668a7a2 3b6ceb7b 6c1f2ad8
d548a4d3 34b5cdce 32535ed3 d122116a d8afc534 082b8877
fdc6f728 66d0b743 935f868a 80be4a94 e4d953ca 69bbf480
ff0ba33b bb7f88a4 05403841 7d74b823 3499f387 76e8a8ad
a7fd0d91 07cda676 23df07ca d8afaa75 cfc245e7 10bb201d
f6308f10 52b5fb79 66ab41f9


Thanks xue daoming for conversion but its not working
, I tried searching the charset and encoding but no
solution till now....


Best Regards,
Sanjeev

--- xue daoming <xu...@gmail.com> wrote:
> I think you can do as just below:
> byte[] buf  =
> x509certificate.getPublicKey().getEncoded();
> String s = new String(buf);
> 
> 
> On Thu, 10 Mar 2005 02:35:03 +0000 (GMT), Sanjeev
> Srivastava
> <sa...@yahoo.co.uk> wrote:
> > Hi All
> > 
> > Can anybody tell me how to convert this Byte [] to
> > String..
> > 
> > byte[] buf =
> > x509certificate.getPublicKey().getEncoded();
> > 
> > Please help....
> > 
> > Thanks,
> > Sanjeev
> > 
> > Send instant messages to your online friends
> http://uk.messenger.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 

Send instant messages to your online friends http://uk.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: memory usage

Posted by QM <qm...@brandxdev.net>.
On Fri, Mar 18, 2005 at 07:43:41PM +0100, t.n.a. wrote:
: rough measurements). The memory usage seems to grow up to a 100 MB 
: (Cayenne accesses a single table of about fifty attributes and a 1000 
: rows - don't ask) and sometimes - I can't reproduce the problem now - 
: the app brakes when trying to open a new page. The exception says 
: something about not having enough memory.
: Ring any bells, anyone?



Yes -- if a Java app is out of memory,

1/ invest in a profiler to see whether there's a resource leak
2/ increase the heap such that the JVM has more space in which to create
objects

btw, please post a *new* message when writing to the list.  Replying to
an old (unrelated) message confuses thread-aware mailers, which makes
your question harder to find (and thus answer).

-QM

-- 

software   -- http://www.brandxdev.net
tech news  -- http://www.RoarNetworX.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


memory usage

Posted by "t.n.a." <tn...@sharanet.org>.
Hi everyone,

I'm not quite sure where to post this problem - the tomcat, tapestry or 
cayenne mailing list - but here goes...
I have an app built on the mentioned technologies. I click arround and 
monitor the memory usage (using the Win task manager - good enough for 
rough measurements). The memory usage seems to grow up to a 100 MB 
(Cayenne accesses a single table of about fifty attributes and a 1000 
rows - don't ask) and sometimes - I can't reproduce the problem now - 
the app brakes when trying to open a new page. The exception says 
something about not having enough memory.
Ring any bells, anyone?

Thanks for your effort,
Tomislav

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org