Java Reference
In-Depth Information
Figure 6.5 Getting MobileAerith using NetBeans Update Center
We open up the application and see a great SVG UI. We would like
to browse some of our private pictures on our image-hosting website.
That has two technical requirements - user authentication when signing
in and interoperability with a remote web service.
The precondition to uploading and downloading pictures from the
image-hosting website is signing in, which we can achieve using JSR-177
SATSA. To avoid passing a readable text password from client to server,
you can send an MD5 - a message digest (a small 'fingerprint' of a larger
set of data) - of the password; if this matches the one on the server, the
client is authenticated.
The following code demonstrates how to create an MD5 message
digest using JSR-177 SATSA:
// MD5 digest length is 128 bits
byte[] digest = new byte[16];
java.security.MessageDigest md =
java.security.MessageDigest.getInstance("MD5");
md.update(password, 0, password.length);
md.digest(digest, 0, digest.length);
JSR-172 Web Services give us the interoperability with the web service.
There are other ways to communicate with a remote service, for example,
JavaScript Object Notation (JSON), a text-based data interchange format,
and REST, but a major benefit of using JSR-172 is that under MSA it
becomes a standard JSR. There is no need to maintain proprietary code
or third-party packages.
Search WWH ::




Custom Search