Class EPPSecDNSExtKeyData

java.lang.Object
com.verisign.epp.codec.secdnsext.v11.EPPSecDNSExtKeyData
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPSecDNSExtKeyData extends Object implements EPPCodecComponent
The EPPSecDNSExtKeyData is the EPPCodecComponent that knows how to encode and decode secDNS keyData elements from/to XML and object instance.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The default protocol vale.
    static final int
    Bit 7 of the Flags field is the Zone Key flag.
    static final int
    Bit 15 of the Flags field is the Secure Entry Point flag.
    static final int
    Maximum alg value
    static final int
    Maximum flags value
    static final int
    Maximum protocol value
    static final int
    Minimum alg value
    static final int
    Minimum flags value
    static final int
    Minimum protocol value
    static final int
    Unspecified alg value
    static final int
    Unspecified flags value
    static final int
    Unspecified protocol value
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance of EPPSecDNSExtKeyData
    EPPSecDNSExtKeyData(int flags, int protocol, int alg, String pubKey)
    Create a new instance of EPPSecDNSExtKeyData with the given values.
    Create a new instance (copy) of EPPSecDNSExtKeyData
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone EPPSecDNSExtKeyData.
    void
    decode(Element aElement)
    Populate the data of this instance with the data stored in the given Element of the DOM tree
    encode(Document aDocument)
    Append all data from this secDNS:keyData to the given DOM Document
    boolean
    equals(Object aObject)
    implements a deep EPPSecDNSExtKeyData compare.
    int
    Get secDNS:alg value
    int
    Get secDNS:flags value
    Returns the XML namespace associated with the EPPCodecComponent.
    int
    Get secDNS:protocol value
    Get secDNS:pubKey value
    void
    setAlg(int alg)
    Set secDNS:alg value
    void
    setFlags(int flags)
    Set secDNS:flags value
    void
    setProtocol(int protocol)
    Set secDNS:protocol value
    void
    setPubKey(String pubKey)
    Set secDNS:pubKey value This method will remove all whitespace in an effort to produce the canonical representation for base64Binary as defined by http://www.w3.org/TR/xmlschema-2/#base64Binary
    toDsData(String aDomainName, int aDigestType)
    Generates a EPPSecDNSExtDsData with the key data utilizing the domain name (aDomainName) and the desired digest type ( aDigestType).
    int
    Generate the key tag used in the DS data and included in the EPPSecDNSExtDsData return by toDsData(String, int).
    Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_PROTOCOL

      public static final int DEFAULT_PROTOCOL
      The default protocol vale. http://www.ietf.org/rfc/rfc4034.txt 2.1.2. The Protocol Field The Protocol Field MUST have value 3, and the DNSKEY RR MUST be treated as invalid during signature verification if it is found to be some value other than 3.
      See Also:
    • FLAGS_ZONE_KEY

      public static final int FLAGS_ZONE_KEY
      Bit 7 of the Flags field is the Zone Key flag. If bit 7 has value 1, then the DNSKEY record holds a DNS zone key.
      See Also:
    • FLAGS_ZONE_KEY_SEP

      public static final int FLAGS_ZONE_KEY_SEP
      Bit 15 of the Flags field is the Secure Entry Point flag. If bit 15 has value 1, then the DNSKEY record holds a key intended for use as a secure entry point (SEP).
      See Also:
    • UNSPEC_FLAGS

      public static final int UNSPEC_FLAGS
      Unspecified flags value
      See Also:
    • MIN_FLAGS

      public static final int MIN_FLAGS
      Minimum flags value
      See Also:
    • MAX_FLAGS

      public static final int MAX_FLAGS
      Maximum flags value
      See Also:
    • UNSPEC_PROTOCOL

      public static final int UNSPEC_PROTOCOL
      Unspecified protocol value
      See Also:
    • MIN_PROTOCOL

      public static final int MIN_PROTOCOL
      Minimum protocol value
      See Also:
    • MAX_PROTOCOL

      public static final int MAX_PROTOCOL
      Maximum protocol value
      See Also:
    • UNSPEC_ALG

      public static final int UNSPEC_ALG
      Unspecified alg value
      See Also:
    • MIN_ALG

      public static final int MIN_ALG
      Minimum alg value
      See Also:
    • MAX_ALG

      public static final int MAX_ALG
      Maximum alg value
      See Also:
  • Constructor Details

    • EPPSecDNSExtKeyData

      public EPPSecDNSExtKeyData()
      Create a new instance of EPPSecDNSExtKeyData
    • EPPSecDNSExtKeyData

      public EPPSecDNSExtKeyData(EPPSecDNSExtKeyData keyData)
      Create a new instance (copy) of EPPSecDNSExtKeyData
      Parameters:
      keyData - EPPSecDNSExtKeyData instance
    • EPPSecDNSExtKeyData

      public EPPSecDNSExtKeyData(int flags, int protocol, int alg, String pubKey)
      Create a new instance of EPPSecDNSExtKeyData with the given values.
      Parameters:
      flags - the flags value to use for this instance.
      protocol - the protocol value to use for this instance.
      alg - the algorithm value to use for this instance.
      pubKey - the public key value to use for this instance.
  • Method Details

    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Append all data from this secDNS:keyData to the given DOM Document
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - The DOM Document to append data to
      Returns:
      Encoded DOM Element
      Throws:
      EPPEncodeException - Thrown when errors occur during the encode attempt or if the instance is invalid.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Populate the data of this instance with the data stored in the given Element of the DOM tree
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - The root element of the fragment of XML
      Throws:
      EPPDecodeException - Thrown if any errors occur during decoding.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPSecDNSExtKeyData compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPSecDNSExtKeyData instance to compare with
      Returns:
      true if equal false otherwise
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPSecDNSExtKeyData.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPSecDNSExtKeyData
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • getFlags

      public int getFlags()
      Get secDNS:flags value
      Returns:
      an int value representing secDNS:flags
      See Also:
      • UNSPEC_FLAGS
    • setFlags

      public void setFlags(int flags)
      Set secDNS:flags value
      Parameters:
      flags - an int value representing secDNS:flags
      See Also:
      • FLAGS_ZONE_KEY_SEP
      • FLAGS_ZONE_KEY
    • getProtocol

      public int getProtocol()
      Get secDNS:protocol value
      Returns:
      an int value representing secDNS:protocol
      See Also:
      • DEFAULT_PROTOCOL
      • UNSPEC_PROTOCOL
    • setProtocol

      public void setProtocol(int protocol)
      Set secDNS:protocol value
      Parameters:
      protocol - an int value representing secDNS:protocol
    • getAlg

      public int getAlg()
      Get secDNS:alg value
      Returns:
      an int value representing secDNS:alg
      See Also:
      • UNSPEC_ALG
    • setAlg

      public void setAlg(int alg)
      Set secDNS:alg value
      Parameters:
      alg - an int value representing secDNS:alg
    • getPubKey

      public String getPubKey()
      Get secDNS:pubKey value
      Returns:
      the canonical representation of the base64Binary secDNS:pubKey
      See Also:
    • setPubKey

      public void setPubKey(String pubKey)
      Set secDNS:pubKey value This method will remove all whitespace in an effort to produce the canonical representation for base64Binary as defined by http://www.w3.org/TR/xmlschema-2/#base64Binary
      Parameters:
      pubKey - an String value representing the base64Binary secDNS:pubKey
      See Also:
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • toDsData

      public EPPSecDNSExtDsData toDsData(String aDomainName, int aDigestType) throws EPPCodecException
      Generates a EPPSecDNSExtDsData with the key data utilizing the domain name (aDomainName) and the desired digest type ( aDigestType). The DS data is generated based on RFC 4032, where the DS digest is calculated as shown below:
      "|" denotes concatenation
      digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA);
      DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key
      Parameters:
      aDomainName - Domain name / owner name of DNSKEY
      aDigestType - Desired digest type of generated DS using a EPPSecDNSExtDsData DIGEST_TYPE constant like EPPSecDNSExtDsData.SHA1_DIGEST_TYPE or EPPSecDNSExtDsData.SHA256_DIGEST_TYPE.
      Returns:
      Instance of EPPSecDNSExtDsData representing the generated DS data
      Throws:
      EPPCodecException - On error generating the DS data
    • toKeyTag

      public int toKeyTag() throws EPPCodecException
      Generate the key tag used in the DS data and included in the EPPSecDNSExtDsData return by toDsData(String, int).
      Returns:
      Key tag based on the key data
      Throws:
      EPPCodecException - On error generating the key tag
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.