com.verisign.epp.codec.verificationcode

## Class TrustAnchorVerificationData

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

-     public class TrustAnchorVerificationData
      extends java.lang.Object

  A class to simulate validating a verification code value by utilizing the encoding of the trust anchor alias in a trust store, which could be formatted in the following way using Augmented Backus-Naur Form (ABNF) grammar:

       alias = codevspid ":" vspid ":" profilename ":" codetypes ":" shortname ":" certnumber
       codevspid  = 1*DIGIT ; Verification Code vsp-id value
       vspid      = 1*DIGIT ; Surrogate VSP Identifier
       profilename= 1*(DIGIT / ALPHA) ; Name of profile
       codetypes  = codetype *( “~“ codetype) ; List of supported signed code types
       codetype   = 1*(DIGIT / ALPHA / “-“) ; <verificationCode:signedCode> “type” attribute
       shortname  = 1*(DIGIT / ALPHA) ; VSP Short name
       certnumber = 1*DIGIT  ; Unique certificate number

  An example alias for the EPPSDK could be "0:-1:china:domain~real-name:eppsdk:1"

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `UNDEFINED` Undefined integer value of the verification data.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrustAnchorVerificationData()` Default constructor.
    `TrustAnchorVerificationData(java.lang.String aTrustAnchorAlias)` Constructor that takes a trust anchor alias from a trust store to be decoded.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCodeType(java.lang.String aCodeType)` Adds a code type to the list of code types.
    `void` | `decode(java.lang.String aTrustAnchorAlias)` Decodes a trust anchor alias from a trust store to set the trust anchor verification data.
    `java.lang.String` | `encode()` Encodes a trust anchor anchor for a trust store.
    `boolean` | `equals(java.lang.Object aObject)` implements a deep `TrustAnchorVerificationData` compare.
    `int` | `getCertNumber()` Gets the Verification Service Provider (VSP) trust anchor certificate number.
    `java.util.List<java.lang.String>` | `getCodeTypes()` Gets the list of code types, per the "type" attribute of <verificationCode:code>, supported by the Verification Service Provider (VSP).
    `int` | `getCodeVspId()` Gets the Verification Code vsp-id value per draft-gould-eppext-verificationcode.
    `java.lang.String` | `getProfileName()` Gets the name of the locality profile associated with the Verification Service Provider (VSP).
    `java.lang.String` | `getShortName()` Gets the short name of the Verification Service Provider (VSP).
    `int` | `getVspId()` Gets the internal (surrogate) Verification Service Provider (VSP) identifier.
    `boolean` | `hasCertNumber()` Has the Verification Service Provider (VSP) trust anchor certificate number been set?
    `boolean` | `hasCodeTypes()` Are there any code types?
    `boolean` | `hasCodeVspId()` Has the Verification Code vsp-id value been set?
    `boolean` | `hasProfileName()` Has the locality profile associated with the Verification Service Provider (VSP) been set?
    `boolean` | `hasShortName()` Has VSP short name been set?
    `boolean` | `hasVspId()` Has the internal (surrogate) Verification Service Provider (VSP) identifier been set?
    `void` | `setCertNumber(int aCertNumber)` Sets the Verification Service Provider (VSP) trust anchor certificate number.
    `void` | `setCodeTypes(java.util.List<java.lang.String> aCodeTypes)` Sets the list of code types, per the "type" attribute of <verificationCode:code>, supported by the Verification Service Provider (VSP).
    `void` | `setCodeVspId(int aCodeVspId)` Sets the Verification Code vsp-id value per draft-gould-eppext-verificationcode.
    `void` | `setProfileName(java.lang.String aProfileName)` Sets the name of the locality profile associated with the Verification Service Provider (VSP).
    `void` | `setShortName(java.lang.String aShortName)` Sets the short name of the Verification Service Provider (VSP).
    `void` | `setVspId(int aVspId)` Sets the internal (surrogate) Verification Service Provider (VSP) identifier.

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

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

- - ### Field Detail

    - #### UNDEFINED

          public static int UNDEFINED

      Undefined integer value of the verification data.

  - ### Constructor Detail

    - #### TrustAnchorVerificationData

          public TrustAnchorVerificationData()

      Default constructor.

    - #### TrustAnchorVerificationData

          public TrustAnchorVerificationData(java.lang.String aTrustAnchorAlias)
                                      throws EPPException

      Constructor that takes a trust anchor alias from a trust store to be decoded.
      Parameters:
        `aTrustAnchorAlias` - Alias of the trust anchor from a trust store.
      Throws:
        `EPPException` - Error decoding the trust anchor alias

  - ### Method Detail

    - #### hasCodeVspId

          public boolean hasCodeVspId()

      Has the Verification Code vsp-id value been set?
      Returns:
        `true` of the Verification Code vsp-id value has been set; `false` otherwise.

    - #### getCodeVspId

          public int getCodeVspId()

      Gets the Verification Code vsp-id value per draft-gould-eppext-verificationcode.
      Returns:
        Verification Code vsp-id value per draft-gould-eppext-verificationcode if defined; `UNDEFINED` otherwise.

    - #### setCodeVspId

          public void setCodeVspId(int aCodeVspId)

      Sets the Verification Code vsp-id value per draft-gould-eppext-verificationcode.
      Parameters:
        `aCodeVspId` - Verification Code vsp-id value per draft-gould-eppext-verificationcode

    - #### hasVspId

          public boolean hasVspId()

      Has the internal (surrogate) Verification Service Provider (VSP) identifier been set?
      Returns:
        `true` of the internal (surrogate) Verification Service Provider (VSP) identifier has been set; `false` otherwise.

    - #### getVspId

          public int getVspId()

      Gets the internal (surrogate) Verification Service Provider (VSP) identifier. This can be matched up with records in a database.
      Returns:
        internal (surrogate) Verification Service Provider (VSP) identifier if defined; `UNDEFINED` otherwise.

    - #### setVspId

          public void setVspId(int aVspId)

      Sets the internal (surrogate) Verification Service Provider (VSP) identifier. This can be matched up with records in a database.
      Parameters:
        `aVspId` - Internal (surrogate) Verification Service Provider (VSP) identifier.

    - #### hasProfileName

          public boolean hasProfileName()

      Has the locality profile associated with the Verification Service Provider (VSP) been set?
      Returns:
        `true` of the locality profile associated with the Verification Service Provider (VSP) has been set; `false` otherwise.

    - #### getProfileName

          public java.lang.String getProfileName()

      Gets the name of the locality profile associated with the Verification Service Provider (VSP).
      Returns:
        The locality profile associated with the Verification Service Provider (VSP) if defined; `null` otherwise.

    - #### setProfileName

          public void setProfileName(java.lang.String aProfileName)

      Sets the name of the locality profile associated with the Verification Service Provider (VSP).
      Parameters:
        `aProfileName` - Locality profile associated with the Verification Service Provider (VSP).

    - #### hasCodeTypes

          public boolean hasCodeTypes()

      Are there any code types?
      Returns:
        `true` if there are code types; `false` otherwise.

    - #### addCodeType

          public void addCodeType(java.lang.String aCodeType)

      Adds a code type to the list of code types.
      Parameters:
        `aCodeType` - Code type to add to the list of code types.

    - #### getCodeTypes

          public java.util.List<java.lang.String> getCodeTypes()

      Gets the list of code types, per the "type" attribute of <verificationCode:code>, supported by the Verification Service Provider (VSP).
      Returns:
        List of code types supported by the Verification Service Provider (VSP).

    - #### setCodeTypes

          public void setCodeTypes(java.util.List<java.lang.String> aCodeTypes)

      Sets the list of code types, per the "type" attribute of <verificationCode:code>, supported by the Verification Service Provider (VSP).
      Parameters:
        `aCodeTypes` - List of code types supported by the Verification Service Provider (VSP).

    - #### hasShortName

          public boolean hasShortName()

      Has VSP short name been set?
      Returns:
        `true` of the VSP short name has been set; `false` otherwise.

    - #### getShortName

          public java.lang.String getShortName()

      Gets the short name of the Verification Service Provider (VSP). The short name must only contain alphanumeric characters.
      Returns:
        Short name of the Verification Service Provider (VSP) if defined; `null` otherwise.

    - #### setShortName

          public void setShortName(java.lang.String aShortName)

      Sets the short name of the Verification Service Provider (VSP). The short name must only contain alphanumeric characters.
      Parameters:
        `aShortName` - Short name of the Verification Service Provider (VSP).

    - #### hasCertNumber

          public boolean hasCertNumber()

      Has the Verification Service Provider (VSP) trust anchor certificate number been set?
      Returns:
        `true` of the Verification Service Provider (VSP) trust anchor certificate number has been set; `false` otherwise.

    - #### getCertNumber

          public int getCertNumber()

      Gets the Verification Service Provider (VSP) trust anchor certificate number. This must be unique across all trust anchor certificates for the VSP.
      Returns:
        Verification Service Provider (VSP) trust anchor certificate number if defined; `null` otherwise.

    - #### setCertNumber

          public void setCertNumber(int aCertNumber)

      Sets the Verification Service Provider (VSP) trust anchor certificate number. This must be unique across all trust anchor certificates for the VSP.
      Parameters:
        `aCertNumber` - Unique certificate number for the VSP

    - #### decode

          public void decode(java.lang.String aTrustAnchorAlias)
                      throws EPPException

      Decodes a trust anchor alias from a trust store to set the trust anchor verification data.
      Parameters:
        `aTrustAnchorAlias` - Alias of the trust anchor from a trust store.
      Throws:
        `EPPException` - Error decoding the trust anchor alias

    - #### encode

          public java.lang.String encode()
                                  throws EPPException

      Encodes a trust anchor anchor for a trust store.
      Returns:
        Trust anchor alias for a trust store.
      Throws:
        `EPPException` - Error encoding the trust anchor alias

    - #### equals

          public boolean equals(java.lang.Object aObject)

      implements a deep `TrustAnchorVerificationData` compare.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - `TrustAnchorVerificationData` instance to compare with
      Returns:
        `true` if equal `false` otherwise