Re: [Jsdsi-users] Re: <What's the correct way to send over Proof?>
Status: Pre-Alpha
Brought to you by:
sajma
From: Sameer A. <aj...@cs...> - 2004-05-05 13:15:01
|
To clarify: Client: FileOutputStream pd_file_out = new FileOutputStream("server_agent_queue.txt", true); jsdsi.sexp.ObjOutputStream pd_oos = new jsdsi.sexp.ObjOutputStream(pd_file_out); ==> pd_oos.writeCanonical(proof.getSequence()); pd_file_out.close(); Server: FileInputStream file_in = new FileInputStream("server_agent_queue.txt"); jsdsi.sexp.ObjInputStream ois = new jsdsi.sexp.ObjInputStream(fis); while (true) { if (ois.available() > 0) { ==> jsdsi.Proof pf = new Proof (Certificate.fromSequence ((jsdsi.Sequence) ois.readObj())); break; } } This is another case where a better API is needed. Any suggestions? Probably the most sensible is just to make the way you wanted to use it (Obj.parseObj()) work, i.e., provide Proof.parseProof(). Sameer > You can transfer a Proof as a Sequence (using proof.getSequence). But > we should probably add support for transferring it just as a Proof. The > reason I didn't in the firts place is because Proof isn't actually an > official SPKI/SDSI datatype---it's specific to JSDSI. > > Sameer > >> Dear Sameer, Sean, and jsdsi experts, >> >> Orignial NameCert or AuthCert which are be embedded in Certifcate can >> be sent and receive well by using CertificateFactory Engine But now, >> after the client generates proof from certificate discovery, how >> should I send this over correctly? Currently, I try to use >> jsdsi.ObjOutputStream and jsdsi.ObjInputStream: Client: >> FileOutputStream pd_file_out = new >> FileOutputStream("server_agent_queue.txt", true); >> jsdsi.sexp.ObjOutputStream pd_oos = new >> jsdsi.sexp.ObjOutputStream(pd_file_out); >> pd_oos.writeCanonical(proof); >> pd_file_out.close(); >> >> Server: >> FileInputStream file_in = new >> FileInputStream("server_agent_queue.txt"); jsdsi.sexp.ObjInputStream >> ois = new jsdsi.sexp.ObjInputStream(fis); while (true) { >> if (ois.available() > 0) { >> ===> jsdsi.Proof pf = (jsdsi.Proof) ois.readObj(); >> break; >> } >> } >> >> But it occures following error on ===> line: >> jsdsi.sexp.SexpParseException: unrecognized object type: proof >> >> Any idea, please? and Thanks for answer in advanced! >> >> Sincerely, >> >> Matt > > > http://ajmani.net > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Jsdsi-users mailing list > Jsd...@li... > https://lists.sourceforge.net/lists/listinfo/jsdsi-users http://ajmani.net |