|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.verisign.epp.codec.verificationcode.EPPSignedCode
public class EPPSignedCode
Class for the signed code, which contains the verification code and the
XMLSignature
.
Field Summary | |
---|---|
static java.lang.String |
ELM_SIGNED_CODE
Constant for the code tag for signedCode element |
static java.lang.String |
ELM_SIGNED_CODE_LOCALNAME
Constant for the code local name for signedCode element |
Constructor Summary | |
---|---|
EPPSignedCode()
Create an EPPSignedCode instance. |
|
EPPSignedCode(byte[] aSignedCodeArray)
Create the EPPSignedCode object from the input
byte[] (XML). |
|
EPPSignedCode(EPPEncodedSignedCodeValue aEncodedSignedCode)
Convert an EPPEncodedSignedCode into an
EPPSignedCode . |
|
EPPSignedCode(EPPVerificationCode aCode)
Create an EPPSignedCode with the code of the signed code. |
|
EPPSignedCode(java.lang.String aCode,
java.lang.String aType)
Create an EPPSignedCode with the type and code of the signed
code. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone EPPSignedCode . |
protected void |
decode(byte[] aSignedCodeArray)
Create a DOM document from byte array. |
void |
decode(org.w3c.dom.Element aElement)
Decode the EPPSignedCode component |
byte[] |
encode()
Encode the signed code 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 EPPSignedCode compare. |
java.lang.String |
getAttrIdValue()
Gets the "id" attribute value. |
EPPVerificationCode |
getCode()
Gets the code value associated with the signed code. |
java.lang.String |
getCodeType()
Gets the code type of the contained code. |
java.lang.String |
getCodeValue()
Gets the code value of the contained code. |
java.lang.String |
getLocalName()
Gets the XML local name for the signed code. |
void |
sign(java.security.PrivateKey aPrivateKey)
Digitally sign the signed code using the passed private key. |
void |
sign(java.security.PrivateKey aPrivateKey,
java.security.cert.Certificate[] aCertChain)
Digitally sign the signed code 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 code 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 code 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 code attributes. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ELM_SIGNED_CODE_LOCALNAME
public static final java.lang.String ELM_SIGNED_CODE
Constructor Detail |
---|
public EPPSignedCode()
EPPSignedCode
instance.
public EPPSignedCode(EPPEncodedSignedCodeValue aEncodedSignedCode)
EPPEncodedSignedCode
into an
EPPSignedCode
.
aEncodedSignedCode
- EPPEncodedSignedCode
to convert from.public EPPSignedCode(EPPVerificationCode aCode) throws EPPEncodeException
EPPSignedCode
with the code of the signed code.
The default encoding is XML and the signature must be generated by
calling sign(PrivateKey)
. Once the object is created using this
constructor, one should not update the object. In the case the object
gets updated, changes will not be included in XML/signature.
aCode
- Verification code
EPPEncodeException
- Thrown if any errors prevent encoding.public EPPSignedCode(java.lang.String aCode, java.lang.String aType) throws EPPEncodeException
EPPSignedCode
with the type and code of the signed
code. The default encoding is XML and the signature must be generated by
calling sign(PrivateKey)
. Once the object is created using this
constructor, one should not update the object. In the case the object
gets updated, changes will not be included in XML/signature.
aCode
- Verification codeaType
- Type of the verification code
EPPEncodeException
- Thrown if any errors prevent encoding.public EPPSignedCode(byte[] aSignedCodeArray) throws EPPDecodeException
EPPSignedCode
object from the input
byte[]
(XML).
aSignedCodeArray
- byte[]
to decode the attribute values
EPPDecodeException
- Error decoding the byte[]
.Method Detail |
---|
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
EPPSignedCode
component
decode
in interface EPPCodecComponent
aElement
- Root element of the EPPSignedCode
EPPDecodeException
- Error decoding the EPPSignedCode
protected void decode(byte[] aSignedCodeArray) throws EPPDecodeException
aSignedCodeArray
- byte[]
to decode the attribute values
EPPDecodeException
- Error decoding the byte[]
.public byte[] encode() throws EPPEncodeException
byte[]
.
byte[]
representing signed code
EPPEncodeException
- Error encoding the signed codepublic 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
EPPSignedCode
. Signature element is not cloned.
clone
in interface EPPCodecComponent
clone
in class java.lang.Object
EPPSignedCode
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 code
EPPException
- 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 codeaCertChain
- 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 signature
true
if valid; false
otherwise.public boolean equals(java.lang.Object aObject)
EPPSignedCode
compare.
equals
in class java.lang.Object
aObject
- EPPSignedCode
instance to compare with
public java.lang.String getLocalName()
ELM_SIGNED_MARK_LOCALNAME
or
ELM_ENCODED_SIGNED_MARK_LOCALNAME
public EPPVerificationCode getCode()
null
otherwise.public java.lang.String getCodeValue()
public java.lang.String getCodeType()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |