Class MockTrustEngine<TokenType>

java.lang.Object
org.opensaml.security.testing.MockTrustEngine<TokenType>
Type Parameters:
TokenType - token type for trust engine
All Implemented Interfaces:
TrustEngine<TokenType>

public class MockTrustEngine<TokenType> extends Object implements TrustEngine<TokenType>
Mock trust engine.
  • Field Details

    • trusted

      private boolean trusted
      Trusted flag.
    • throwable

      @Nullable private Throwable throwable
      Exception to raise.
  • Constructor Details

    • MockTrustEngine

      public MockTrustEngine(boolean flag)
      Constructor.
      Parameters:
      flag - flag controlling whether the trust engine mock should accept the input or not.
    • MockTrustEngine

      public MockTrustEngine(@Nullable Throwable t)
      Constructor.
      Parameters:
      t - exception to raise from mock.
  • Method Details

    • validate

      public boolean validate(@Nonnull TokenType token, @Nullable CriteriaSet trustBasisCriteria) throws SecurityException
      Validates the token against trusted information obtained in an implementation-specific manner.
      Specified by:
      validate in interface TrustEngine<TokenType>
      Parameters:
      token - security token to validate
      trustBasisCriteria - criteria used to describe and/or resolve the information which serves as the basis for trust evaluation
      Returns:
      true iff the token is trusted and valid
      Throws:
      SecurityException - thrown if there is a problem validating the security token