NAME
  libCB - provide a way to use credit card

SYNOPSIS
  local libCB = require("libCB")

DESCRIPTION
  Use this lib to access a credit card. A credit card is a special unmanaged floppy disk

  Data structure
    cbData:table
      uuid	--account uuid
      cbUUID	--card uuid
      type -- card's component type ("signed" or "unsigned")
      [sig]		--card signature made form uuid & card's drive component's uuid. Absent on magData

  Method list
    Common methods
      waitForCB():proxy
        wait for any compatible debit card format to be read or available.
        Return the reader's component proxy for later use with loadCB() or getCB().
      loadCB(cbDrive):table
        cbDrive:proxy > the component to read the card from
      getCB(rawCBdata,pin):cbData
        rawCBdata:table > the raw card data to decrypt. Obtained with loadCB
        pin:string > user pin code
      getCB(cbDrive,pin):cbData
        cbDrive:proxy > the drive or os_magreader component proxy for the credit card
        pin:string > user pin code
      checkCBdata(cbData,publicKey):boolean
        cbDrive:proxy > the drive or os_magreader component proxy for the credit card
        publicKey:userdata > data card compatible publicKey
      writeCB(rawCBdata,cbDrive)
        rawCBdata:string|table > data to be written to the new credit card
        cbDrive:proxy > the drive or os_cardwriter component proxy for the credit card
    
    Server only methods :
      createNew(uuid,cbUUID,privateKey):rawCBdata
        uuid:string > account uuid
        cbUUID:string|nil > the future credit card uuid
        privateKey:userdata > data card compatible publicKey
        If cbUUID is omitted, the function will return unsigned and smaller data. Useful for things like 

  Returned values
    cbData

FILE
  /usr/lib/libCB.lua
    the library

  SEE ALSO
    bank_api

AUTHOR
  AR2000
