Class EPPSignedMark
java.lang.Object
com.verisign.epp.codec.signedMark.EPPSignedMark
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
- Direct Known Subclasses:
EPPEncodedSignedMark
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
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for the mark local name for signedMark elementstatic final StringConstant for the mark tag for signedMark elementstatic final StringNamespace URI associated with EPPLaunchExtFactory.static final StringNamespace prefix associated with EPPLaunchExtFactory.static final StringXML Schema definition for EPPLaunchExtFactory -
Constructor Summary
ConstructorsConstructorDescriptionCreate anEPPSignedMarkinstance.EPPSignedMark(byte[] aSignedMarkArray) Create theEPPSignedMarkobject from the inputbyte[](XML).EPPSignedMark(EPPEncodedSignedMark aEncodedSignedMark) Convert anEPPEncodedSignedMarkinto anEPPSignedMark.Create anEPPSignedMarkwith the id, issuer, not before date, not after date, and the mark attributes of the signed mark. -
Method Summary
Modifier and TypeMethodDescriptionclone()CloneEPPSignedMark.protected voiddecode(byte[] aSignedMarkArray) Create a DOM document from byte array.voidDecode theEPPSignedMarkcomponentbyte[]encode()Encode the signed mark to abyte[].Sets all this instance's data in the given XML documentbooleanimplements a deepEPPSignedMarkcompare.Gets the "id" attribute value.getId()Gets the identifier of the signed mark.Gets issuer of the signed mark.Gets the XML local name for the signed mark.getMark()Gets the mark associated with the signed mark.Returns the XML namespace associated with theEPPCodecComponent.Gets the date of expiration of the signed mark.Gets the date of creation of the signed mark.voidsign(PrivateKey aPrivateKey) Digitally sign the signed mark using the passed private key.voidsign(PrivateKey aPrivateKey, Certificate[] aCertChain) Digitally sign the signed mark using the passed private key and a chain of certificates.toString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.booleanvalidate(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 theXMLSignaturewith using the passed PKIX parameters to the PKIXCertPathValidatoralgorithm.booleanvalidate(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 theXMLSignaturewith using the passed PKIX parameters to the PKIXCertPathValidatoralgorithm.booleanValidate the signature attribute against the signed mark attributes.
-
Field Details
-
NS
Namespace URI associated with EPPLaunchExtFactory.- See Also:
-
NS_PREFIX
Namespace prefix associated with EPPLaunchExtFactory.- See Also:
-
NS_SCHEMA
XML Schema definition for EPPLaunchExtFactory- See Also:
-
ELM_SIGNED_MARK_LOCALNAME
Constant for the mark local name for signedMark element- See Also:
-
ELM_SIGNED_MARK_NAME
Constant for the mark tag for signedMark element- See Also:
-
-
Constructor Details
-
EPPSignedMark
public EPPSignedMark()Create anEPPSignedMarkinstance. -
EPPSignedMark
Convert anEPPEncodedSignedMarkinto anEPPSignedMark.- Parameters:
aEncodedSignedMark-EPPEncodedSignedMarkto convert from.
-
EPPSignedMark
public EPPSignedMark(String aId, EPPIssuer aIssuer, Date aNotBefore, Date aNotAfter, EPPMark aMark) throws EPPEncodeException, EPPDecodeException Create anEPPSignedMarkwith 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 callingsign(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 markaIssuer- Signed mark issuer informationaNotBefore- 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
Create theEPPSignedMarkobject from the inputbyte[](XML).- Parameters:
aSignedMarkArray-byte[]to decode the attribute values- Throws:
EPPDecodeException- Error decoding thebyte[].
-
-
Method Details
-
decode
Decode theEPPSignedMarkcomponent- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root element of theEPPSignedMark- Throws:
EPPDecodeException- Error decoding theEPPSignedMark
-
decode
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 thebyte[].
-
encode
Encode the signed mark to abyte[].- Returns:
byte[]representing signed mark- Throws:
EPPEncodeException- Error encoding the signed mark
-
encode
Sets all this instance's data in the given XML document- Specified by:
encodein interfaceEPPCodecComponent- 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
CloneEPPSignedMark. Signature element is not cloned.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPSignedMark - Throws:
CloneNotSupportedException- standard Object.clone exception
-
sign
Digitally sign the signed mark using the passed private key. No certificates will be added using this method. If certificates need to be added usesign(PrivateKey, Certificate[]).- Parameters:
aPrivateKey- Private key used to sign the signed mark- Throws:
EPPException- Error creating the digital signature
-
sign
Digitally sign the signed mark using the passed private key and a chain of certificates.- Parameters:
aPrivateKey- Private key used to sign the signed markaCertChain- Certificate chain to include in the XMLSignature associated with the private key. Passnullto not include the certificate chain in the XMLSignature.- Throws:
EPPException- Error creating the digital signature
-
validate
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 theXMLSignaturewith using the passed PKIX parameters to the PKIXCertPathValidatoralgorithm. The trust store can be loaded and used to create an instance ofPKIXParametersto verify the certificate chain included in theXMLSignaturewith the trust anchors included in the trust store. This method will automatically synchronize theaPKIXParametersparameter when used, since it is not thread-safe. Usevalidate(PKIXParameters, boolean)to explicitly set theaPKIXParameterssynchronization setting.- Parameters:
aPKIXParameters- Parameters used as input for the PKIXCertPathValidatoralgorithm.- Returns:
trueif valid;falseotherwise.
-
validate
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 theXMLSignaturewith using the passed PKIX parameters to the PKIXCertPathValidatoralgorithm. The trust store can be loaded and used to create an instance ofPKIXParametersto verify the certificate chain included in theXMLSignaturewith the trust anchors included in the trust store.- Parameters:
aPKIXParameters- Parameters used as input for the PKIXCertPathValidatoralgorithm.aSynchronizePKIXParameters- Should theaPKIXParametersbe synchronized inside the method? If there is no reason to synchronize, thenfalsecan be passed to increase performance.- Returns:
trueif valid;falseotherwise.
-
validate
Validate the signature attribute against the signed mark attributes.- Parameters:
aPublicKey- Public used to validate the signature- Returns:
trueif valid;falseotherwise.
-
equals
implements a deepEPPSignedMarkcompare. -
getLocalName
Gets the XML local name for the signed mark.- Returns:
- Either
ELM_SIGNED_MARK_LOCALNAMEorELM_ENCODED_SIGNED_MARK_LOCALNAME
-
getId
Gets the identifier of the signed mark.- Returns:
- The identifier for the signed mark if set;
nullotherwise.
-
getIssuer
Gets issuer of the signed mark.- Returns:
- The issuer of the signed mark if defined:
nullotherwise.
-
getNotBefore
Gets the date of creation of the signed mark.- Returns:
- the date of creation of the signed mark if set;
nullotherwise.
-
getNotAfter
Gets the date of expiration of the signed mark.- Returns:
- the date of expiration of the signed mark if set;
nullotherwise.
-
getMark
Gets the mark associated with the signed mark.- Returns:
- The mark associated with the signed mark if defined:
nullotherwise.
-
getAttrIdValue
Gets the "id" attribute value.- Returns:
- Value of the "id" attribute value.
-
toString
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent. -
getNamespace
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-