com.verisign.epp.codec.verificationcode

## Class TrustAnchorVerificationCodeValidator

- java.lang.Object
- - com.verisign.epp.codec.verificationcode.TrustAnchorVerificationCodeValidator

- All Implemented Interfaces:
    EPPVerificationCodeValidator

      public class TrustAnchorVerificationCodeValidator
      extends java.lang.Object
      implements EPPVerificationCodeValidator

  Concrete verification code validator that leverages the encoding of the trust anchor aliases in the verification code trust store to apply specific validations, which include:
  1. VSP Identifier (vsp-id) in the code value
  2. Code type
  The encoding of the trust anchor aliases is defined by `TrustAnchorVerificationData`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrustAnchorVerificationCodeValidator(java.security.KeyStore aTrustStore)` Constructor of `TrustAnchorVerificationCodeValidator` that takes the trust store containing the verification code trust anchors with the aliases encoding according to the format defined in `TrustAnchorVerificationData`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `validate(EPPVerificationCode aVerificationCode, java.lang.Object aData)` Validate the contents of a verification code using the trust anchor of the signed code to look up the trust store alias, and then using the trust store alias to apply the validation logic for the verification code.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TrustAnchorVerificationCodeValidator

          public TrustAnchorVerificationCodeValidator(java.security.KeyStore aTrustStore)

      Constructor of `TrustAnchorVerificationCodeValidator` that takes the trust store containing the verification code trust anchors with the aliases encoding according to the format defined in `TrustAnchorVerificationData`.
      Parameters:
        `aTrustStore` - Trust store to lookup the trust anchor alias to apply the policy.

  - ### Method Detail

    - #### validate

          public boolean validate(EPPVerificationCode aVerificationCode,
                                  java.lang.Object aData)
                           throws EPPException

      Validate the contents of a verification code using the trust anchor of the signed code to look up the trust store alias, and then using the trust store alias to apply the validation logic for the verification code.
      Specified by:
        `validate` in interface `EPPVerificationCodeValidator`
      Parameters:
        `aVerificationCode` - Verification code to validate
        `aData` - Must be the `TrustAnchor` of the `EPPSignedCode`.
      Returns:
        `true` if the verification code is valid; `false` otherwise.
      Throws:
        `EPPException` - Error executing the validation.