OK. The main thing about WSS4J is that it works as a black box. You don't need to generate the BinarySecurityToken yourself; if you use the supplied handler WSDoAllSender() then the token is generated for you, starting from files. You need to supply a Java key-store (.jks) file holding the certificate and private key and some configuration, in WSDD and in a properties file, to your client programme. The WSDD declares the handler to the client's Axis engine and states the location of the properties file. The properties file itself configures the handler, including the information for finding and reading the key-store file.
Of course, if you _need_ to use a different handler then this approach doesn't work. In that case you might dismantle WSS4J to find the token-writing code or you could write directly to the XMLsec API. I've never used XMLsec directly, but I assume that it has classes mapped to BinarySecurityToken. HTH. On Fri, 7 Oct 2005, Anna Krajewska wrote: > I'm trying to use WSS4j. I wrote a handler that can get the message in xml > dom format, I attached a BinarySecurityToken Element to it, but I don't know > what should I fill it with? I know that it supposed to be binary > base64encoded data but what data? What should I take from the certificate: > public key, sinature, something else? > > ----- Original Message ----- > From: "Guy Rixon" <[EMAIL PROTECTED]> > To: "axis-user" <[email protected]>; "Anna Krajewska" > <[EMAIL PROTECTED]> > Sent: Thursday, October 06, 2005 7:35 PM > Subject: Re: How to create BinarySecurityToken from X509Certificate? > > > > Use WSS4J. If you configure the handler WSDoAllSender to need such a > token, > > e.g. as part of a signature, then it will make one for you from a > key-store > > that you supply. If you pick apart the WSS4J package you will probably > find > > the classes that generated the binary token XML from Java objects. > > > > > > Guy Rixon [EMAIL PROTECTED] > > Institute of Astronomy Tel: +44-1223-337542 > > Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523 > > -- > ========================= > Anna Krajewska > > Departament Informatyki > > tel: +48 32 33 25 541 > fax: +48 32 33 25 505 > email: [EMAIL PROTECTED] > ---------------------------------------------------- > WASKO S.A. > ul. Berbeckiego 6 > 44-100 Gliwice > ---------------------------------------------------- > Guy Rixon [EMAIL PROTECTED] Institute of Astronomy Tel: +44-1223-337542 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523
