public class EPPSignedMark extends java.lang.Object implements EPPCodecComponent
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.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELM_SIGNED_MARK_LOCALNAME
Constant for the mark local name for signedMark element
|
static java.lang.String |
ELM_SIGNED_MARK_NAME
Constant for the mark tag for signedMark element
|
static java.lang.String |
NS
Namespace URI associated with EPPLaunchExtFactory.
|
static java.lang.String |
NS_PREFIX
Namespace prefix associated with EPPLaunchExtFactory.
|
static java.lang.String |
NS_SCHEMA
XML Schema definition for EPPLaunchExtFactory
|
Constructor and Description |
---|
EPPSignedMark()
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(java.lang.String aId,
EPPIssuer aIssuer,
java.util.Date aNotBefore,
java.util.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. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clone
EPPSignedMark . |
protected void |
decode(byte[] aSignedMarkArray)
Create a DOM document from byte array.
|
void |
decode(org.w3c.dom.Element aElement)
Decode the
EPPSignedMark component |
byte[] |
encode()
Encode the signed mark to a
byte[] . |
org.w3c.dom.Element |
encode(org.w3c.dom.Document aDocument)
Sets all this instance's data in the given XML document
|
boolean |
equals(java.lang.Object aObject)
implements a deep
EPPSignedMark compare. |
java.lang.String |
getAttrIdValue()
Gets the "id" attribute value.
|
java.lang.String |
getId()
Gets the identifier of the signed mark.
|
EPPIssuer |
getIssuer()
Gets issuer of the signed mark.
|
java.lang.String |
getLocalName()
Gets the XML local name for the signed mark.
|
EPPMark |
getMark()
Gets the mark associated with the signed mark.
|
java.lang.String |
getNamespace()
Returns the XML namespace associated with the
EPPCodecComponent . |
java.util.Date |
getNotAfter()
Gets the date of expiration of the signed mark.
|
java.util.Date |
getNotBefore()
Gets the date of creation of the signed mark.
|
void |
sign(java.security.PrivateKey aPrivateKey)
Digitally sign the signed mark using the passed private key.
|
void |
sign(java.security.PrivateKey aPrivateKey,
java.security.cert.Certificate[] aCertChain)
Digitally sign the signed mark using the passed private key and a chain of
certificates.
|
java.lang.String |
toString()
Implementation of
Object.toString , which will result in an
indented XML String representation of the concrete
EPPCodecComponent . |
boolean |
validate(java.security.cert.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(java.security.cert.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(java.security.PublicKey aPublicKey)
Validate the signature attribute against the signed mark attributes.
|
public static final java.lang.String NS
public static final java.lang.String NS_PREFIX
public static final java.lang.String NS_SCHEMA
public static final java.lang.String ELM_SIGNED_MARK_LOCALNAME
public static final java.lang.String ELM_SIGNED_MARK_NAME
public EPPSignedMark()
EPPSignedMark
instance.public EPPSignedMark(EPPEncodedSignedMark aEncodedSignedMark)
EPPEncodedSignedMark
into an
EPPSignedMark
.aEncodedSignedMark
- EPPEncodedSignedMark
to convert from.public EPPSignedMark(java.lang.String aId, EPPIssuer aIssuer, java.util.Date aNotBefore, java.util.Date aNotAfter, EPPMark aMark) throws EPPEncodeException, EPPDecodeException
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.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 informationEPPEncodeException
- Thrown if any errors prevent encoding.EPPDecodeException
- Error decoding the Issuer or Mark object.public EPPSignedMark(byte[] aSignedMarkArray) throws EPPDecodeException
EPPSignedMark
object from the input
byte[]
(XML).aSignedMarkArray
- byte[]
to decode the attribute valuesEPPDecodeException
- Error decoding the byte[]
.public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
EPPSignedMark
componentdecode
in interface EPPCodecComponent
aElement
- Root element of the EPPSignedMark
EPPDecodeException
- Error decoding the EPPSignedMark
protected void decode(byte[] aSignedMarkArray) throws EPPDecodeException
aSignedMarkArray
- byte[]
to decode the attribute valuesEPPDecodeException
- Error decoding the byte[]
.public byte[] encode() throws EPPEncodeException
byte[]
.byte[]
representing signed markEPPEncodeException
- Error encoding the signed markpublic org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
encode
in interface EPPCodecComponent
aDocument
- a DOM Document to attach data to.EPPEncodeException
- Thrown if any errors prevent encoding.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
EPPSignedMark
. Signature element is not cloned.clone
in interface EPPCodecComponent
clone
in class java.lang.Object
EPPSignedMark
java.lang.CloneNotSupportedException
- standard Object.clone exceptionpublic void sign(java.security.PrivateKey aPrivateKey) throws EPPException
sign(PrivateKey, Certificate[])
.aPrivateKey
- Private key used to sign the signed markEPPException
- Error creating the digital signaturepublic void sign(java.security.PrivateKey aPrivateKey, java.security.cert.Certificate[] aCertChain) throws EPPException
aPrivateKey
- Private key used to sign the signed markaCertChain
- Certificate chain to include in the XMLSignature associated with the
private key. Pass null
to not include the certificate
chain in the XMLSignature.EPPException
- Error creating the digital signaturepublic boolean validate(java.security.cert.PKIXParameters aPKIXParameters)
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.aPKIXParameters
- Parameters used as input for the PKIX CertPathValidator
algorithm.true
if valid; false
otherwise.public boolean validate(java.security.cert.PKIXParameters aPKIXParameters, boolean aSynchronizePKIXParameters)
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.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.true
if valid; false
otherwise.public boolean validate(java.security.PublicKey aPublicKey)
aPublicKey
- Public used to validate the signaturetrue
if valid; false
otherwise.public boolean equals(java.lang.Object aObject)
EPPSignedMark
compare.equals
in class java.lang.Object
aObject
- EPPSignedMark
instance to compare withpublic java.lang.String getLocalName()
ELM_SIGNED_MARK_LOCALNAME
or
ELM_ENCODED_SIGNED_MARK_LOCALNAME
public java.lang.String getId()
null
otherwise.public EPPIssuer getIssuer()
null
otherwise.public java.util.Date getNotBefore()
null
otherwise.public java.util.Date getNotAfter()
null
otherwise.public EPPMark getMark()
null
otherwise.public java.lang.String getAttrIdValue()
public java.lang.String toString()
Object.toString
, which will result in an
indented XML String
representation of the concrete
EPPCodecComponent
.toString
in class java.lang.Object
String
if successful; ERROR
otherwise.public java.lang.String getNamespace()
EPPCodecComponent
.getNamespace
in interface EPPCodecComponent
EPPCodecComponent
.Copyright © VeriSign Inc. All Rights Reserved.