org.opensaml.xml.security.trust
Class ExplicitKeyTrustEngine

java.lang.Object
  extended by org.opensaml.xml.security.trust.ExplicitKeyTrustEngine
All Implemented Interfaces:
TrustedCredentialTrustEngine<Credential>, TrustEngine<Credential>

public class ExplicitKeyTrustEngine
extends Object
implements TrustedCredentialTrustEngine<Credential>

Trust engine that evaluates a credential's key against key(s) expressed within a set of trusted credentials obtained from a trusted credential resolver. The credential being tested is valid if its public key or secret key matches the public key, or secret key respectively, contained within any of the trusted credentials produced by the given credential resolver.


Constructor Summary
ExplicitKeyTrustEngine(CredentialResolver resolver)
          Constructor.
 
Method Summary
protected  void checkParams(Credential untrustedCredential, CriteriaSet trustBasisCriteria)
          Check the parameters for required values.
 CredentialResolver getCredentialResolver()
          Gets the credential resolver used to recover trusted credentials that may be used to validate tokens.
 boolean validate(Credential untrustedCredential, CriteriaSet trustBasisCriteria)
          Validates the token against trusted information obtained in an implementation-specific manner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplicitKeyTrustEngine

public ExplicitKeyTrustEngine(CredentialResolver resolver)
Constructor.

Parameters:
resolver - credential resolver which is used to resolve trusted credentials
Method Detail

getCredentialResolver

public CredentialResolver getCredentialResolver()
Gets the credential resolver used to recover trusted credentials that may be used to validate tokens.

Specified by:
getCredentialResolver in interface TrustedCredentialTrustEngine<Credential>
Returns:
credential resolver used to recover trusted credentials that may be used to validate tokens

validate

public boolean validate(Credential untrustedCredential,
                        CriteriaSet trustBasisCriteria)
                 throws SecurityException
Validates the token against trusted information obtained in an implementation-specific manner.

Specified by:
validate in interface TrustEngine<Credential>
Parameters:
untrustedCredential - security token to validate
trustBasisCriteria - criteria used to describe and/or resolve the information which serves as the basis for trust evaluation
Returns:
true if the token is trusted and valid, false if not
Throws:
SecurityException - thrown if there is a problem validating the security token

checkParams

protected void checkParams(Credential untrustedCredential,
                           CriteriaSet trustBasisCriteria)
                    throws SecurityException
Check the parameters for required values.

Parameters:
untrustedCredential - the credential to be evaluated
trustBasisCriteria - the set of trusted credential criteria
Throws:
SecurityException - thrown if required values are absent or otherwise invalid


Copyright © 2006-2010 Internet2. All Rights Reserved.