net.jini.security.proxytrust
Class ProxyTrustVerifier

java.lang.Object
  extended bynet.jini.security.proxytrust.ProxyTrustVerifier
All Implemented Interfaces:
TrustVerifier

public class ProxyTrustVerifier
extends Object
implements TrustVerifier

Trust verifier for service proxies that use dynamically downloaded code. This class is intended to be specified in a resource to configure the operation of Security.verifyObjectTrust.

Since:
2.0
Implementation Specifics:
This implementation uses the Logger named net.jini.security.trust to log information at the following levels:
Level Description
FAILED no verifier is obtained from a ProxyTrustIterator
HANDLED RemoteException being passed to ProxyTrustIterator.setException
FINE ProxyTrust.getProxyVerifier remote call returns a trust verifier
FINER an object with a getProxyTrustIterator method is encountered
FINER each object produced by a ProxyTrustIterator

Nested Class Summary
 
Nested classes inherited from class net.jini.security.TrustVerifier
TrustVerifier.Context
 
Constructor Summary
ProxyTrustVerifier()
          Creates an instance.
 
Method Summary
 boolean isTrustedObject(Object obj, TrustVerifier.Context ctx)
          Returns true if the specified object is known to be trusted to correctly implement its contract; returns false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyTrustVerifier

public ProxyTrustVerifier()
Creates an instance.

Method Detail

isTrustedObject

public boolean isTrustedObject(Object obj,
                               TrustVerifier.Context ctx)
                        throws RemoteException
Returns true if the specified object is known to be trusted to correctly implement its contract; returns false otherwise.

This method returns false if the caller context collection of the specified trust verifier context does not contain a MethodConstraints instance with non-empty constraints for the ProxyTrust.getProxyVerifier method, or if a TrustVerifier cannot be obtained from the specified object using the steps described below. Otherwise a TrustVerifier is obtained, its isTrustedObject method is called with the same arguments passed to this method, and the result of that call is returned by this method.

A verifier is obtained from a candidate object as follows. The candidate object's class must have a non-static member method with signature:

ProxyTrustIterator getProxyTrustIterator();
or the candidate object must be an instance of a dynamically generated Proxy class and the contained invocation handler's class must have such a member method. If neither condition holds, no verifier is obtained from the candidate object. Otherwise, the getProxyTrustIterator method is called (on the candidate object or its invocation handler). For each object produced by the next method of the returned iterator, the following checks are made, until either a verifier is obtained or the iteration terminates. If no verifier can be obtained, but one or more of the intermediate operations throws a RemoteException, the last such RemoteException is thrown by this method (rather than this method returning false). If any intermediate operation throws a SecurityException exception, that exception is immediately thrown to the caller.

Specified by:
isTrustedObject in interface TrustVerifier
Parameters:
obj - the object in which to verify trust
ctx - the trust verifier context, to aid in verification of the specified object and its components
Returns:
true if the specified object is known to be trusted to correctly implement its contract; false otherwise
Throws:
NullPointerException - if any argument is null
SecurityException - if a security exception occurs
RemoteException - if a communication-related exception occurs


Copyright © 2004 Sun Microsystems, Inc. All rights reserved