The existing SignedAdvertisement does not work because it does not have
indexed fields. As a result, once it is published, it will be buried in the
CM dungeon and nobody is able to discover it.
Anyway, this message is not to discuss about the SignedAdvertisement. It
should be deprecated because I have re-engineered the Advertisement class.
Now it makes signing and verifying an advertisement much easier to use and
There are five methods in the Advertisement class.
public final XMLSignature getSignature();
public final Document getSignedDocument();
public final synchronized boolean isAuthenticated();
public final synchronized boolean sign(Certificate paraCert, PrivateKey
public final synchronized boolean verify();
It works like this:
//Before you publish your advertisement in New York:
//Construct it as you normally do. Populate something to myAdv.
boolean ok = myAdv.sign(myCert, myPrivateKey);
//Suppose ok is true. Publish it.
//Somebody discovers your advertisement in London:
boolean ok = yourAdv.verify();
//Suppose ok is true. He may want to know who signed it. Then he can do:
XMLSignature signer = yourAdv.getSignature();
The isAuthenticated() returns true when sign or verify returns true.
The getSignedDcoument() returns the original document (unsigned) appended
with a signature (if it exists).
Any existing advertisement implementation does not have to change anything
in order to benefit from the signature feature.