/* ----------------------------------------------------------------------------
 * 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_EIDCard extends PTEID_SmartCard {
  private long swigCPtr;

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

  protected static long getCPtr(PTEID_EIDCard 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_EIDCard(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public static boolean isApplicationAllowed() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_isApplicationAllowed();
  }

  public boolean isTestCard() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_isTestCard(swigCPtr, this);
  }

  public boolean getAllowTestCard() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_getAllowTestCard(swigCPtr, this);
  }

  public void setAllowTestCard(boolean allow) throws PTEID_Exception {
    pteidlibJava_WrapperJNI.PTEID_EIDCard_setAllowTestCard(swigCPtr, this, allow);
  }

  public PTEID_XMLDoc getDocument(PTEID_DocumentType type) throws PTEID_Exception {
    return new PTEID_XMLDoc(pteidlibJava_WrapperJNI.PTEID_EIDCard_getDocument(swigCPtr, this, type.swigValue()), false);
  }

  public PTEID_CCXML_Doc getXmlCCDoc(PTEID_XmlUserRequestedInfo userRequestedInfo) {
    return new PTEID_CCXML_Doc(pteidlibJava_WrapperJNI.PTEID_EIDCard_getXmlCCDoc(swigCPtr, this, PTEID_XmlUserRequestedInfo.getCPtr(userRequestedInfo), userRequestedInfo), false);
  }

  public PTEID_EId getID() throws PTEID_Exception {
    return new PTEID_EId(pteidlibJava_WrapperJNI.PTEID_EIDCard_getID(swigCPtr, this), false);
  }

  public PTEID_Address getAddr() throws PTEID_Exception {
    return new PTEID_Address(pteidlibJava_WrapperJNI.PTEID_EIDCard_getAddr(swigCPtr, this), false);
  }

  public PTEID_Sod getSod() {
    return new PTEID_Sod(pteidlibJava_WrapperJNI.PTEID_EIDCard_getSod(swigCPtr, this), false);
  }

  public PTEID_CardVersionInfo getVersionInfo() throws PTEID_Exception {
    return new PTEID_CardVersionInfo(pteidlibJava_WrapperJNI.PTEID_EIDCard_getVersionInfo(swigCPtr, this), false);
  }

  public boolean writePersonalNotes(PTEID_ByteArray out, PTEID_Pin pin, String csPinCode) {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_writePersonalNotes__SWIG_0(swigCPtr, this, PTEID_ByteArray.getCPtr(out), out, PTEID_Pin.getCPtr(pin), pin, csPinCode);
  }

  public boolean writePersonalNotes(PTEID_ByteArray out, PTEID_Pin pin) {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_writePersonalNotes__SWIG_1(swigCPtr, this, PTEID_ByteArray.getCPtr(out), out, PTEID_Pin.getCPtr(pin), pin);
  }

  public boolean writePersonalNotes(PTEID_ByteArray out) {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_writePersonalNotes__SWIG_2(swigCPtr, this, PTEID_ByteArray.getCPtr(out), out);
  }

  public String readPersonalNotes() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_readPersonalNotes(swigCPtr, this);
  }

  public PTEID_Certificate getCert(PTEID_CertifType type) throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_EIDCard_getCert(swigCPtr, this, type.swigValue()), false);
  }

  public PTEID_Certificate getRoot() throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_EIDCard_getRoot(swigCPtr, this), false);
  }

  public PTEID_Certificate getCA() throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_EIDCard_getCA(swigCPtr, this), false);
  }

  public PTEID_Certificate getSignature() throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_EIDCard_getSignature(swigCPtr, this), false);
  }

  public PTEID_Certificate getAuthentication() throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_EIDCard_getAuthentication(swigCPtr, this), false);
  }

  public PTEID_PublicKey getRootCAPubKey() throws PTEID_Exception {
    return new PTEID_PublicKey(pteidlibJava_WrapperJNI.PTEID_EIDCard_getRootCAPubKey(swigCPtr, this), false);
  }

  public boolean isActive() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_isActive(swigCPtr, this);
  }

  public void doSODCheck(boolean check) throws PTEID_Exception {
    pteidlibJava_WrapperJNI.PTEID_EIDCard_doSODCheck(swigCPtr, this, check);
  }

  public boolean Activate(String pinCode, PTEID_ByteArray BCDDate) {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_Activate(swigCPtr, this, pinCode, PTEID_ByteArray.getCPtr(BCDDate), BCDDate);
  }

  public PTEID_ByteArray SignXades(String[] paths, long n_paths, String output_path) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXades(swigCPtr, this, paths, n_paths, output_path), true);
  }

  public PTEID_ByteArray SignXadesT(String[] path, long n_paths, String output_path) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXadesT(swigCPtr, this, path, n_paths, output_path), true);
  }

  public PTEID_ByteArray SignXadesA(String[] path, long n_paths, String output_path) {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXadesA(swigCPtr, this, path, n_paths, output_path), true);
  }

  public void SignXadesIndividual(String[] paths, long n_paths, String output_path) throws PTEID_Exception {
    pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXadesIndividual(swigCPtr, this, paths, n_paths, output_path);
  }

  public void SignXadesTIndividual(String[] paths, long n_paths, String output_path) throws PTEID_Exception {
    pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXadesTIndividual(swigCPtr, this, paths, n_paths, output_path);
  }

  public void SignXadesAIndividual(String[] paths, long n_paths, String output_path) {
    pteidlibJava_WrapperJNI.PTEID_EIDCard_SignXadesAIndividual(swigCPtr, this, paths, n_paths, output_path);
  }

  public int SignPDF(PTEID_PDFSignature sig_handler, int page, int page_sector, String location, String reason, String outfile_path) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_SignPDF__SWIG_0(swigCPtr, this, PTEID_PDFSignature.getCPtr(sig_handler), sig_handler, page, page_sector, location, reason, outfile_path);
  }

  public int SignPDF(PTEID_PDFSignature sig_handler, int page, double coord_x, double coord_y, String location, String reason, String outfile_path) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_SignPDF__SWIG_1(swigCPtr, this, PTEID_PDFSignature.getCPtr(sig_handler), sig_handler, page, coord_x, coord_y, location, reason, outfile_path);
  }

  public boolean ChangeCapPin(String new_pin) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_ChangeCapPin(swigCPtr, this, new_pin);
  }

  public boolean ChangeAddress(String secretCode, String process, SWIGTYPE_p_f_p_void_int__void callback, SWIGTYPE_p_void callback_data) {
    return pteidlibJava_WrapperJNI.PTEID_EIDCard_ChangeAddress(swigCPtr, this, secretCode, process, SWIGTYPE_p_f_p_void_int__void.getCPtr(callback), SWIGTYPE_p_void.getCPtr(callback_data));
  }

  public boolean ChangeCapPinCompLayer(String old_pin, String new_pin, PTEID_ulwrapper ulRemaining) throws PTEID_Exception {
	  long		pRemaining = pteidlibJava_WrapperJNI.new_ulongp();				// get a C++ ptr
	  boolean	retval     = pteidlibJava_WrapperJNI.PTEID_EIDCard_ChangeCapPinCompLayer(swigCPtr, this, old_pin, new_pin, pRemaining);
	  
	  ulRemaining.m_long = pteidlibJava_WrapperJNI.ulongp_value(pRemaining);
	  pteidlibJava_WrapperJNI.delete_ulongp(pRemaining);
	  return retval;
}

  public PTEID_ByteArray getRawData(PTEID_RawDataType type) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_EIDCard_getRawData(swigCPtr, this, type.swigValue()), false);
  }

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

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

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

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

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

  public PTEID_ByteArray getRawData_Sod() {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_EIDCard_getRawData_Sod(swigCPtr, this), false);
  }

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

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

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

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

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

}
