10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Securing Containers<br />

Message-Layer Security<br />

Securing Containers<br />

772<br />

In message-layer security, security information is contained within the SOAP message and/or<br />

SOAP message attachment, which allows security information to travel along with the message<br />

or attachment. For example, a portion of the message may be signed by a sender and encrypted<br />

for a particular receiver. When the message is sent from the initial sender, it may pass through<br />

intermediate nodes before reaching its intended receiver. In this scenario, the encrypted<br />

portions continue to be opaque to any intermediate nodes and can only be decrypted by the<br />

intended receiver. For this reason, message-layer security is also sometimes referred to as<br />

end-to-end security.<br />

<strong>The</strong> advantages of message-layer security include the following:<br />

■ Security stays with the message over all hops and after the message arrives at its destination.<br />

■ Security can be selectively applied to different portions of a message (and to attachments if<br />

using XWSS).<br />

■ Message security can be used with intermediaries over multiple hops.<br />

■ Message security is independent of the application environment or transport protocol.<br />

<strong>The</strong> disadvantage of using message-layer security is that it is relatively complex and adds some<br />

overhead to processing.<br />

<strong>The</strong> Application Server supports message security. It uses Web Services Security (WSS) to<br />

secure messages. Because this message security is specific to the Application Server and not a<br />

part of the <strong>Java</strong> <strong>EE</strong> platform, this tutorial does not discuss using WSS to secure messages. See the<br />

<strong>Oracle</strong> GlassFish Server 2.1.2 Administration Guide and <strong>Oracle</strong> GlassFish Server 2.1.2 Developer’s<br />

Guide for more information.<br />

In <strong>Java</strong> <strong>EE</strong>, the component containers are responsible for providing application security. A<br />

container provides two types of security: declarative and programmatic. <strong>The</strong> following sections<br />

discuss these concepts in more detail.<br />

Using Deployment Descriptors for Declarative<br />

Security<br />

Declarative security expresses an application component’s security requirements using<br />

deployment descriptors. A deployment descriptor is an XML document with an .xml extension<br />

that describes the deployment settings of an application, a module, or a component. Because<br />

deployment descriptor information is declarative, it can be changed without the need to modify<br />

the source code. At runtime, the <strong>Java</strong> <strong>EE</strong> server reads the deployment descriptor and acts upon<br />

the application, module, or component accordingly.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!