Class Bank

java.lang.Object
org.kopi.ebics.client.Bank
All Implemented Interfaces:
Serializable, EbicsBank, Savable

public class Bank extends Object implements EbicsBank, Savable
Simple implementation of an EBICS bank. This object is serializable to facilitate persisting of the values. Save the object whenever it needs to be saved.
See Also:
  • Constructor Details

    • Bank

      public Bank(URL url, String name, String hostId)
      Constructs a new EBICS bank with the data you should have obtained from the bank.
      Parameters:
      url - the bank URL
      name - the bank name
      hostId - the bank host ID
  • Method Details

    • save

      public void save(ObjectOutputStream oos) throws IOException
      Description copied from interface: Savable
      Writes all persistable attributes to the given stream.
      Specified by:
      save in interface Savable
      Parameters:
      oos - the given stream.
      Throws:
      IOException - save process failed
    • needsSave

      public boolean needsSave()
      Did any persistent attribute change since last load/save operation.
      Returns:
      True if the object needs to be saved.
    • getURL

      public URL getURL()
      Description copied from interface: EbicsBank
      Returns the URL needed for communication to the bank.
      Specified by:
      getURL in interface EbicsBank
      Returns:
      the URL needed for communication to the bank.
    • getE002Digest

      public byte[] getE002Digest()
      Description copied from interface: EbicsBank
      Returns the encryption key digest you have obtained from the bank. Ensure that nobody was able to modify the digest on its way from the bank to you.
      Specified by:
      getE002Digest in interface EbicsBank
      Returns:
      the encryption key digest you have obtained from the bank.
    • getX002Digest

      public byte[] getX002Digest()
      Description copied from interface: EbicsBank
      Returns the authentication key digest you have obtained from the bank. Ensure that nobody was able to modify the digest on its way from the bank to you.
      Specified by:
      getX002Digest in interface EbicsBank
      Returns:
      the authentication key digest you have obtained from the bank.
    • getE002Key

      public RSAPublicKey getE002Key()
      Description copied from interface: EbicsBank
      Returns the banks encryption key.
      Specified by:
      getE002Key in interface EbicsBank
      Returns:
      the banks encryption key.
    • getX002Key

      public RSAPublicKey getX002Key()
      Description copied from interface: EbicsBank
      Returns the banks authentication key.
      Specified by:
      getX002Key in interface EbicsBank
      Returns:
      the banks authentication key.
    • getHostId

      public String getHostId()
      Description copied from interface: EbicsBank
      Returns the bank's id.
      Specified by:
      getHostId in interface EbicsBank
      Returns:
      the bank's id.
    • getName

      public String getName()
      Description copied from interface: EbicsBank
      Returns the bank's name.
      Specified by:
      getName in interface EbicsBank
      Returns:
      the bank's name.
    • setBankKeys

      public void setBankKeys(RSAPublicKey e002Key, RSAPublicKey x002Key)
      Description copied from interface: EbicsBank
      Keys have been fetched from the bank. The getters for the appropriate attributes should return the given values from now on. For the sake of performance the values should be persisted for later usage.
      Specified by:
      setBankKeys in interface EbicsBank
      Parameters:
      e002Key - the banks encryption key.
      x002Key - the banks authentication key.
    • setDigests

      public void setDigests(byte[] e002Digest, byte[] x002Digest)
      Description copied from interface: EbicsBank
      Sets the bank digests.
      Specified by:
      setDigests in interface EbicsBank
      Parameters:
      e002Digest - encryption digest
      x002Digest - authentication digest
    • getSaveName

      public String getSaveName()
      Description copied from interface: Savable
      Returns the save name of this savable object.
      Specified by:
      getSaveName in interface Savable
      Returns:
      the save name