anon.pay.xml
Class XMLAccountCertificate

java.lang.Object
  extended by anon.pay.xml.XMLAccountCertificate
All Implemented Interfaces:
IXMLEncodable

public class XMLAccountCertificate
extends java.lang.Object
implements IXMLEncodable

This class contains the functionality for creating and parsing XML account certificates. It provides access to the public key pubKey, the account number accountNumber and the timestamp validTime. Note: This class does not perform any signing or signature checking! This is done in XMLSignature, so if you want to generate a signed XML certificate, utilize this class to sign it! The XML account certificates have the following format:

    <?xml version="1.0"?>
    <AccountCertificate version="1.0">
      <AccountNumber>123456789012</AccountNumber>
      <BiID>The BI ID<BiID>
      <JapPublicKey>
        ... public key xml data (see below)
      </JapPublicKey>
      <CreationTime>YYYY-MM-DD</CreationTime>
      <Signature>
        ... signature xml data (see below)
      </Signature>
    </AccountCertificate>
 


Field Summary
private  long m_accountNumber
           
private  java.lang.String m_biID
           
private  java.sql.Timestamp m_creationTime
           
private  org.w3c.dom.Document m_docTheAccountCert
           
private  IMyPublicKey m_publicKey
           
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
XMLAccountCertificate(byte[] xmldata)
           
XMLAccountCertificate(org.w3c.dom.Element xml)
          Creates an AccountCertifcate from an existing XML docuemnt
XMLAccountCertificate(IMyPublicKey publicKey, long accountNumber, java.sql.Timestamp creationTime, java.lang.String biID)
          creates a new XML certificate (NOTE: It will NOT be signed!)
XMLAccountCertificate(java.lang.String xml)
          parses an existing XML certificate
 
Method Summary
 long getAccountNumber()
           
 java.sql.Timestamp getCreationTime()
           
 java.lang.String getPIID()
          Gets the Payment Instance ID of the Payment Instance where this account is residing.
 IMyPublicKey getPublicKey()
           
private  org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)
          Returns an XML represenation
private  void setValues(org.w3c.dom.Element xml)
          Parses the XML representation and sets the internal values
 boolean sign(IMyPrivateKey key)
           
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_publicKey

private IMyPublicKey m_publicKey

m_creationTime

private java.sql.Timestamp m_creationTime

m_accountNumber

private long m_accountNumber

m_biID

private java.lang.String m_biID

m_docTheAccountCert

private org.w3c.dom.Document m_docTheAccountCert
Constructor Detail

XMLAccountCertificate

public XMLAccountCertificate(IMyPublicKey publicKey,
                             long accountNumber,
                             java.sql.Timestamp creationTime,
                             java.lang.String biID)
creates a new XML certificate (NOTE: It will NOT be signed!)

Parameters:
publicKey - public key
accountNumber - account number
creationTime - creation timestamp
biID - the signing BI's ID

XMLAccountCertificate

public XMLAccountCertificate(java.lang.String xml)
                      throws java.lang.Exception
parses an existing XML certificate

Parameters:
xml - the certificate as string
Throws:
java.lang.Exception

XMLAccountCertificate

public XMLAccountCertificate(byte[] xmldata)
                      throws java.lang.Exception
Throws:
java.lang.Exception

XMLAccountCertificate

public XMLAccountCertificate(org.w3c.dom.Element xml)
                      throws java.lang.Exception
Creates an AccountCertifcate from an existing XML docuemnt

Parameters:
xml - the node that represents the AccountCertifcate
Throws:
java.lang.Exception
Method Detail

setValues

private void setValues(org.w3c.dom.Element xml)
                throws java.lang.Exception
Parses the XML representation and sets the internal values

Parameters:
xml - Node
Throws:
java.lang.Exception

internal_toXmlElement

private org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)
Returns an XML represenation

Returns:
Document

getAccountNumber

public long getAccountNumber()

getCreationTime

public java.sql.Timestamp getCreationTime()

getPublicKey

public IMyPublicKey getPublicKey()

sign

public boolean sign(IMyPrivateKey key)

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element

getPIID

public java.lang.String getPIID()
Gets the Payment Instance ID of the Payment Instance where this account is residing.

Returns:
String