Class EPPSignedMark

java.lang.Object
com.verisign.epp.codec.signedMark.EPPSignedMark
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable
Direct Known Subclasses:
EPPEncodedSignedMark

public class EPPSignedMark extends Object implements EPPCodecComponent
Class for the signed mark, which contains the mark (EPPMark), and additional elements associated with the signing of the mark like the serial number of the signed mark, the expiration of the signed mark, and the XMLSignature itself.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant for the mark local name for signedMark element
    static final String
    Constant for the mark tag for signedMark element
    static final String
    Namespace URI associated with EPPLaunchExtFactory.
    static final String
    Namespace prefix associated with EPPLaunchExtFactory.
    static final String
    XML Schema definition for EPPLaunchExtFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an EPPSignedMark instance.
    EPPSignedMark(byte[] aSignedMarkArray)
    Create the EPPSignedMark object from the input byte[] (XML).
    EPPSignedMark(EPPEncodedSignedMark aEncodedSignedMark)
    Convert an EPPEncodedSignedMark into an EPPSignedMark.
    EPPSignedMark(String aId, EPPIssuer aIssuer, Date aNotBefore, Date aNotAfter, EPPMark aMark)
    Create an EPPSignedMark with the id, issuer, not before date, not after date, and the mark attributes of the signed mark.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone EPPSignedMark.
    protected void
    decode(byte[] aSignedMarkArray)
    Create a DOM document from byte array.
    void
    decode(Element aElement)
    Decode the EPPSignedMark component
    byte[]
    Encode the signed mark to a byte[].
    encode(Document aDocument)
    Sets all this instance's data in the given XML document
    boolean
    equals(Object aObject)
    implements a deep EPPSignedMark compare.
    Gets the "id" attribute value.
    Gets the identifier of the signed mark.
    Gets issuer of the signed mark.
    Gets the XML local name for the signed mark.
    Gets the mark associated with the signed mark.
    Returns the XML namespace associated with the EPPCodecComponent.
    Gets the date of expiration of the signed mark.
    Gets the date of creation of the signed mark.
    void
    sign(PrivateKey aPrivateKey)
    Digitally sign the signed mark using the passed private key.
    void
    sign(PrivateKey aPrivateKey, Certificate[] aCertChain)
    Digitally sign the signed mark using the passed private key and a chain of certificates.
    Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
    boolean
    validate(PKIXParameters aPKIXParameters)
    Validate the signature attribute against the signed mark attributes by using the public key of the certificate or the top certificate in the certificate chain contained in the XMLSignature with using the passed PKIX parameters to the PKIX CertPathValidator algorithm.
    boolean
    validate(PKIXParameters aPKIXParameters, boolean aSynchronizePKIXParameters)
    Validate the signature attribute against the signed mark attributes by using the public key of the certificate or the top certificate in the certificate chain contained in the XMLSignature with using the passed PKIX parameters to the PKIX CertPathValidator algorithm.
    boolean
    validate(PublicKey aPublicKey)
    Validate the signature attribute against the signed mark attributes.

    Methods inherited from class java.lang.Object

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

    • NS

      public static final String NS
      Namespace URI associated with EPPLaunchExtFactory.
      See Also:
    • NS_PREFIX

      public static final String NS_PREFIX
      Namespace prefix associated with EPPLaunchExtFactory.
      See Also:
    • NS_SCHEMA

      public static final String NS_SCHEMA
      XML Schema definition for EPPLaunchExtFactory
      See Also:
    • ELM_SIGNED_MARK_LOCALNAME

      public static final String ELM_SIGNED_MARK_LOCALNAME
      Constant for the mark local name for signedMark element
      See Also:
    • ELM_SIGNED_MARK_NAME

      public static final String ELM_SIGNED_MARK_NAME
      Constant for the mark tag for signedMark element
      See Also:
  • Constructor Details

    • EPPSignedMark

      public EPPSignedMark()
      Create an EPPSignedMark instance.
    • EPPSignedMark

      public EPPSignedMark(EPPEncodedSignedMark aEncodedSignedMark)
      Convert an EPPEncodedSignedMark into an EPPSignedMark.
      Parameters:
      aEncodedSignedMark - EPPEncodedSignedMark to convert from.
    • EPPSignedMark

      public EPPSignedMark(String aId, EPPIssuer aIssuer, Date aNotBefore, Date aNotAfter, EPPMark aMark) throws EPPEncodeException, EPPDecodeException
      Create an EPPSignedMark with the id, issuer, not before date, not after date, and the mark attributes of the signed mark. The default encoding is XML and the signature must be generated by calling sign(PrivateKey). Once object is created using this constructor, one should not update the Mark object. In case mark object get updated, changes will not be included in XML/signature.
      Parameters:
      aId - Identifier of signed mark
      aIssuer - Signed mark issuer information
      aNotBefore - Date and time that the signed mark was created.
      aNotAfter - Date and time that the signed mark expires.
      aMark - Mark information
      Throws:
      EPPEncodeException - Thrown if any errors prevent encoding.
      EPPDecodeException - Error decoding the Issuer or Mark object.
    • EPPSignedMark

      public EPPSignedMark(byte[] aSignedMarkArray) throws EPPDecodeException
      Create the EPPSignedMark object from the input byte[] (XML).
      Parameters:
      aSignedMarkArray - byte[] to decode the attribute values
      Throws:
      EPPDecodeException - Error decoding the byte[].
  • Method Details

    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode the EPPSignedMark component
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - Root element of the EPPSignedMark
      Throws:
      EPPDecodeException - Error decoding the EPPSignedMark
    • decode

      protected void decode(byte[] aSignedMarkArray) throws EPPDecodeException
      Create a DOM document from byte array. Initialized the instance variables like mark, issuer etc. Sets the signedMarkElement.
      Parameters:
      aSignedMarkArray - byte[] to decode the attribute values
      Throws:
      EPPDecodeException - Error decoding the byte[].
    • encode

      public byte[] encode() throws EPPEncodeException
      Encode the signed mark to a byte[].
      Returns:
      byte[] representing signed mark
      Throws:
      EPPEncodeException - Error encoding the signed mark
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Sets all this instance's data in the given XML document
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - a DOM Document to attach data to.
      Returns:
      The root element of this component.
      Throws:
      EPPEncodeException - Thrown if any errors prevent encoding.
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPSignedMark. Signature element is not cloned.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPSignedMark
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • sign

      public void sign(PrivateKey aPrivateKey) throws EPPException
      Digitally sign the signed mark using the passed private key. No certificates will be added using this method. If certificates need to be added use sign(PrivateKey, Certificate[]).
      Parameters:
      aPrivateKey - Private key used to sign the signed mark
      Throws:
      EPPException - Error creating the digital signature
    • sign

      public void sign(PrivateKey aPrivateKey, Certificate[] aCertChain) throws EPPException
      Digitally sign the signed mark using the passed private key and a chain of certificates.
      Parameters:
      aPrivateKey - Private key used to sign the signed mark
      aCertChain - Certificate chain to include in the XMLSignature associated with the private key. Pass null to not include the certificate chain in the XMLSignature.
      Throws:
      EPPException - Error creating the digital signature
    • validate

      public boolean validate(PKIXParameters aPKIXParameters)
      Validate the signature attribute against the signed mark attributes by using the public key of the certificate or the top certificate in the certificate chain contained in the XMLSignature with using the passed PKIX parameters to the PKIX CertPathValidator algorithm. The trust store can be loaded and used to create an instance of PKIXParameters to verify the certificate chain included in the XMLSignature with the trust anchors included in the trust store. This method will automatically synchronize the aPKIXParameters parameter when used, since it is not thread-safe. Use validate(PKIXParameters, boolean) to explicitly set the aPKIXParameters synchronization setting.
      Parameters:
      aPKIXParameters - Parameters used as input for the PKIX CertPathValidator algorithm.
      Returns:
      true if valid; false otherwise.
    • validate

      public boolean validate(PKIXParameters aPKIXParameters, boolean aSynchronizePKIXParameters)
      Validate the signature attribute against the signed mark attributes by using the public key of the certificate or the top certificate in the certificate chain contained in the XMLSignature with using the passed PKIX parameters to the PKIX CertPathValidator algorithm. The trust store can be loaded and used to create an instance of PKIXParameters to verify the certificate chain included in the XMLSignature with the trust anchors included in the trust store.
      Parameters:
      aPKIXParameters - Parameters used as input for the PKIX CertPathValidator algorithm.
      aSynchronizePKIXParameters - Should the aPKIXParameters be synchronized inside the method? If there is no reason to synchronize, then false can be passed to increase performance.
      Returns:
      true if valid; false otherwise.
    • validate

      public boolean validate(PublicKey aPublicKey)
      Validate the signature attribute against the signed mark attributes.
      Parameters:
      aPublicKey - Public used to validate the signature
      Returns:
      true if valid; false otherwise.
    • equals

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

      public String getLocalName()
      Gets the XML local name for the signed mark.
      Returns:
      Either ELM_SIGNED_MARK_LOCALNAME or ELM_ENCODED_SIGNED_MARK_LOCALNAME
    • getId

      public String getId()
      Gets the identifier of the signed mark.
      Returns:
      The identifier for the signed mark if set; null otherwise.
    • getIssuer

      public EPPIssuer getIssuer()
      Gets issuer of the signed mark.
      Returns:
      The issuer of the signed mark if defined: null otherwise.
    • getNotBefore

      public Date getNotBefore()
      Gets the date of creation of the signed mark.
      Returns:
      the date of creation of the signed mark if set; null otherwise.
    • getNotAfter

      public Date getNotAfter()
      Gets the date of expiration of the signed mark.
      Returns:
      the date of expiration of the signed mark if set; null otherwise.
    • getMark

      public EPPMark getMark()
      Gets the mark associated with the signed mark.
      Returns:
      The mark associated with the signed mark if defined: null otherwise.
    • getAttrIdValue

      public String getAttrIdValue()
      Gets the "id" attribute value.
      Returns:
      Value of the "id" attribute value.
    • 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.
    • getNamespace

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