/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.11
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package pt.gov.cartaodecidadao;

public class PTEID_SmartCard extends PTEID_Card {
  private long swigCPtr;

  protected PTEID_SmartCard(long cPtr, boolean cMemoryOwn) {
    super(pteidlibJava_WrapperJNI.PTEID_SmartCard_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(PTEID_SmartCard obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        pteidlibJava_WrapperJNI.delete_PTEID_SmartCard(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void selectApplication(PTEID_ByteArray applicationId) throws PTEID_Exception {
    pteidlibJava_WrapperJNI.PTEID_SmartCard_selectApplication(swigCPtr, this, PTEID_ByteArray.getCPtr(applicationId), applicationId);
  }

  public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin, String csPinCode) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_sendAPDU__SWIG_0(swigCPtr, this, PTEID_ByteArray.getCPtr(cmd), cmd, PTEID_Pin.getCPtr(pin), pin, csPinCode), true);
  }

  public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_sendAPDU__SWIG_1(swigCPtr, this, PTEID_ByteArray.getCPtr(cmd), cmd, PTEID_Pin.getCPtr(pin), pin), true);
  }

  public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_sendAPDU__SWIG_2(swigCPtr, this, PTEID_ByteArray.getCPtr(cmd), cmd), true);
  }

  public int readFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin, String csPinCode) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_readFile__SWIG_0(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(in), in, PTEID_Pin.getCPtr(pin), pin, csPinCode);
  }

  public int readFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_readFile__SWIG_1(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(in), in, PTEID_Pin.getCPtr(pin), pin);
  }

  public int readFile(String fileID, PTEID_ByteArray in) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_readFile__SWIG_2(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(in), in);
  }

  public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_writeFile__SWIG_0(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(out), out, PTEID_Pin.getCPtr(pin), pin, csPinCode);
  }

  public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_writeFile__SWIG_1(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(out), out, PTEID_Pin.getCPtr(pin), pin);
  }

  public boolean writeFile(String fileID, PTEID_ByteArray out) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_writeFile__SWIG_2(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(out), out);
  }

  public long pinCount() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_pinCount(swigCPtr, this);
  }

  public PTEID_Pins getPins() throws PTEID_Exception {
    return new PTEID_Pins(pteidlibJava_WrapperJNI.PTEID_SmartCard_getPins(swigCPtr, this), false);
  }

  public long certificateCount() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_certificateCount(swigCPtr, this);
  }

  public PTEID_Certificates getCertificates() throws PTEID_Exception {
    return new PTEID_Certificates(pteidlibJava_WrapperJNI.PTEID_SmartCard_getCertificates(swigCPtr, this), false);
  }

  public PTEID_ByteArray getChallenge(boolean bForceNewInit) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_getChallenge__SWIG_0(swigCPtr, this, bForceNewInit), false);
  }

  public PTEID_ByteArray getChallenge() throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_getChallenge__SWIG_1(swigCPtr, this), false);
  }

  public PTEID_ByteArray getChallengeResponse() throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_SmartCard_getChallengeResponse(swigCPtr, this), false);
  }

  public boolean verifyChallengeResponse(PTEID_ByteArray challenge, PTEID_ByteArray response) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_SmartCard_verifyChallengeResponse(swigCPtr, this, PTEID_ByteArray.getCPtr(challenge), challenge, PTEID_ByteArray.getCPtr(response), response);
  }

}
