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

namespace be.portugal.eid {

using System;
using System.Runtime.InteropServices;

public class PTEID_Certificates : PTEID_Crypto {
  private HandleRef swigCPtr;

  internal PTEID_Certificates(IntPtr cPtr, bool cMemoryOwn) : base(pteidlib_dotNetPINVOKE.PTEID_CertificatesUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(PTEID_Certificates obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~PTEID_Certificates() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        pteidlib_dotNetPINVOKE.delete_PTEID_Certificates(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public PTEID_Certificates() : this(pteidlib_dotNetPINVOKE.new_PTEID_Certificates(), true) {
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public uint countFromCard() {
    uint ret = pteidlib_dotNetPINVOKE.PTEID_Certificates_countFromCard(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint countAll() {
    uint ret = pteidlib_dotNetPINVOKE.PTEID_Certificates_countAll(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCertFromCard(uint ulIndexCard) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getCertFromCard(swigCPtr, ulIndexCard), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCert(uint ulIndexAll) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getCert__SWIG_0(swigCPtr, ulIndexAll), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCert(PTEID_CertifType type) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getCert__SWIG_1(swigCPtr, (int)type), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getRoot() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getRoot(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCA() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getCA(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getSignature() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getSignature(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getAuthentication() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_getAuthentication(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate addCertificate(PTEID_ByteArray cert) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_Certificates_addCertificate(swigCPtr, PTEID_ByteArray.getCPtr(cert)), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
