Top Description Inners Fields Constructors Methods
jakarta.security.auth.message

public Class MessagePolicy

extends Object
Class Inheritance
Imports
jakarta.security.auth.message.config.ClientAuthContext, .ServerAuthContext, jakarta.security.auth.message.module.ClientAuthModule, .ServerAuthModule

This class defines a message authentication policy.

A ClientAuthContext uses this class to communicate (at module initialization time) request and response message protection policies to its ClientAuthModule objects. A ServerAuthContext uses this class to communicate request and response message protection policies to its ServerAuthModule objects.

See Also
ClientAuthContext, ServerAuthContext, ClientAuthModule, ServerAuthModule

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
MessagePolicy.ProtectionPolicy

This interface is used to represent message authentication policy.

public static interface
MessagePolicy.Target

This interface is used to represent and perform message targeting.

public static class
MessagePolicy.TargetPolicy

This class defines the message protection policies for specific Targets.

Field Summary

Modifier and TypeField and Description
private boolean
private MessagePolicy.TargetPolicy[]

Constructor Summary

AccessConstructor and Description
public
MessagePolicy(MessagePolicy.TargetPolicy[]
an array of target policies.
targetPolicies
,
boolean
A boolean value indicating whether the MessagePolicy is mandatory or optional.
mandatory
)

Create a MessagePolicy instance with an array of target policies.

Method Summary

Modifier and TypeMethod and Description
public MessagePolicy.TargetPolicy[]

Returns:

An array of target authentication policies, where each element describes an authentication policy and the parts of the message to which the authentication policy applies. This method returns null to indicate that no security operations should be performed on the messages to which the policy applies. This method never returns a zero-length array.
getTargetPolicies
()

Get the target policies that comprise the authentication policy.

public boolean

Returns:

A boolean indicating whether the MessagePolicy is optional(false) or required(true).
isMandatory
()

Get the MessagePolicy modifier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mandatoryback to summary
private boolean mandatory
targetPoliciesback to summary
private MessagePolicy.TargetPolicy[] targetPolicies

Constructor Detail

MessagePolicyback to summary
public MessagePolicy(MessagePolicy.TargetPolicy[] targetPolicies, boolean mandatory)

Create a MessagePolicy instance with an array of target policies.

Parameters
targetPolicies:MessagePolicy.TargetPolicy[]

an array of target policies.

mandatory:boolean

A boolean value indicating whether the MessagePolicy is mandatory or optional.

Exceptions
IllegalArgumentException:
if the specified targetPolicies is null.

Method Detail

getTargetPoliciesback to summary
public MessagePolicy.TargetPolicy[] getTargetPolicies()

Get the target policies that comprise the authentication policy.

When this method returns an array of target policies, the order of elements in the array represents the order that the corresponding message transformations or validations described by the target policies are to be performed by the authentication module.

Returns:MessagePolicy.TargetPolicy[]

An array of target authentication policies, where each element describes an authentication policy and the parts of the message to which the authentication policy applies. This method returns null to indicate that no security operations should be performed on the messages to which the policy applies. This method never returns a zero-length array.

isMandatoryback to summary
public boolean isMandatory()

Get the MessagePolicy modifier.

Returns:boolean

A boolean indicating whether the MessagePolicy is optional(false) or required(true).

jakarta.security.auth.message back to summary

public Interface MessagePolicy.ProtectionPolicy


This interface is used to represent message authentication policy.

The internal state of a ProtectionPolicy object defines the message authentication requirements to be applied to the associated Target.

Field Summary

Modifier and TypeField and Description
public static final String
AUTHENTICATE_CONTENT

The identifier for a ProtectionPolicy that indicates that the origin of data within the message is to be authenticated (that is, the message is to be protected such that its recipients can establish who defined the message content).

public static final String
AUTHENTICATE_RECIPIENT

The identifier for a ProtectionPolicy that indicates that the message recipient is to be authenticated.

public static final String
AUTHENTICATE_SENDER

The identifier for a ProtectionPolicy that indicates that the sending entity is to be authenticated.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

A String containing a policy identifier. This interface defines some policy identifier constants. Configuration systems may define and employ other policy identifiers values.
getID
()

Get the ProtectionPolicy identifier.

Field Detail

AUTHENTICATE_CONTENTback to summary
public static final String AUTHENTICATE_CONTENT

The identifier for a ProtectionPolicy that indicates that the origin of data within the message is to be authenticated (that is, the message is to be protected such that its recipients can establish who defined the message content).

AUTHENTICATE_RECIPIENTback to summary
public static final String AUTHENTICATE_RECIPIENT

The identifier for a ProtectionPolicy that indicates that the message recipient is to be authenticated.

AUTHENTICATE_SENDERback to summary
public static final String AUTHENTICATE_SENDER

The identifier for a ProtectionPolicy that indicates that the sending entity is to be authenticated.

Method Detail

getIDback to summary
public String getID()

Get the ProtectionPolicy identifier. An identifier may represent a conceptual protection policy (as is the case with the static identifiers defined within this interface) or it may identify a procedural policy expression or plan that may be more difficult to categorize in terms of a conceptual identifier.

Returns:String

A String containing a policy identifier. This interface defines some policy identifier constants. Configuration systems may define and employ other policy identifiers values.

jakarta.security.auth.message back to summary

public Interface MessagePolicy.Target


This interface is used to represent and perform message targeting. Targets are used by message authentication modules to operate on the corresponding content within messages.

The internal state of a Target indicates whether it applies to the request or response message of a MessageInfo and to which components it applies within the identified message.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

An Object representing the target, or null when the target could not be found in the MessageInfo.
get
(MessageInfo
The MessageInfo containing the request or response message from which the target is to be obtained.
messageInfo
)

Get the Object identified by the Target from the MessageInfo.

public void
put(MessageInfo
The MessageInfo containing the request or response message into which the object is to be put.
messageInfo
,
Object
The data to be put into the MessageInfo
data
)

Put the Object into the MessageInfo at the location identified by the target.

public void
remove(MessageInfo
The MessageInfo containing the request or response message from which the target is to be removed.
messageInfo
)

Remove the Object identified by the Target from the MessageInfo.

Method Detail

getback to summary
public Object get(MessageInfo messageInfo)

Get the Object identified by the Target from the MessageInfo.

Parameters
messageInfo:MessageInfo

The MessageInfo containing the request or response message from which the target is to be obtained.

Returns:Object

An Object representing the target, or null when the target could not be found in the MessageInfo.

putback to summary
public void put(MessageInfo messageInfo, Object data)

Put the Object into the MessageInfo at the location identified by the target.

Parameters
messageInfo:MessageInfo

The MessageInfo containing the request or response message into which the object is to be put.

data:Object

The data to be put into the MessageInfo

removeback to summary
public void remove(MessageInfo messageInfo)

Remove the Object identified by the Target from the MessageInfo.

Parameters
messageInfo:MessageInfo

The MessageInfo containing the request or response message from which the target is to be removed.

jakarta.security.auth.message back to summary

public Class MessagePolicy.TargetPolicy

extends Object
Class Inheritance

This class defines the message protection policies for specific Targets.

This class is used to associate a message protection policy with targets within a message. Message targets are represented using an implementation of the Target interface matched to the message types in MessageInfo. The message protection policy is identified by an implementation of the ProtectionPolicy interface.

See Also
ClientAuthModule, ServerAuthModule

Field Summary

Modifier and TypeField and Description
private MessagePolicy.ProtectionPolicy
private MessagePolicy.Target[]

Constructor Summary

AccessConstructor and Description
public
TargetPolicy(MessagePolicy.Target[]
An array of Targets. This argument may be null.
targets
,
MessagePolicy.ProtectionPolicy
The object that describes the message authentication policy that applies to the targets.
protectionPolicy
)

Create a TargetPolicy instance with an array of Targets and with a ProtectionPolicy.

Method Summary

Modifier and TypeMethod and Description
public MessagePolicy.ProtectionPolicy

Returns:

A ProtectionPolicy object that identifies the message authentication requirements that apply to the targets.
getProtectionPolicy
()

Get the ProtectionPolicy that applies to the targets.

public MessagePolicy.Target[]

Returns:

An array of Target that identify targets within a message. This method returns null when the specified policy applies to the whole message (excluding any metadata added to the message to satisfy the policy). This method never returns a zero-length array.
getTargets
()

Get the array of layer-specific target descriptors that identify the one or more message parts to which the specified message protection policy applies.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

protectionPolicyback to summary
private MessagePolicy.ProtectionPolicy protectionPolicy
targetsback to summary
private MessagePolicy.Target[] targets

Constructor Detail

TargetPolicyback to summary
public TargetPolicy(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy)

Create a TargetPolicy instance with an array of Targets and with a ProtectionPolicy.

Parameters
targets:MessagePolicy.Target[]

An array of Targets. This argument may be null.

protectionPolicy:MessagePolicy.ProtectionPolicy

The object that describes the message authentication policy that applies to the targets.

Exceptions
IllegalArgumentException:
if the specified targets or protectionPolicy is null.

Method Detail

getProtectionPolicyback to summary
public MessagePolicy.ProtectionPolicy getProtectionPolicy()

Get the ProtectionPolicy that applies to the targets.

Returns:MessagePolicy.ProtectionPolicy

A ProtectionPolicy object that identifies the message authentication requirements that apply to the targets.

getTargetsback to summary
public MessagePolicy.Target[] getTargets()

Get the array of layer-specific target descriptors that identify the one or more message parts to which the specified message protection policy applies.

Returns:MessagePolicy.Target[]

An array of Target that identify targets within a message. This method returns null when the specified policy applies to the whole message (excluding any metadata added to the message to satisfy the policy). This method never returns a zero-length array.