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

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

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

  public PTEID_Certificates() {
    this(pteidlibJava_WrapperJNI.new_PTEID_Certificates(), true);
  }

  public long countFromCard() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_countFromCard(swigCPtr, this);
  }

  public long countAll() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_countAll(swigCPtr, this);
  }

  public PTEID_Certificate getCertFromCard(long ulIndexCard) throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_Certificates_getCertFromCard(swigCPtr, this, ulIndexCard), false);
  }

  public PTEID_Certificate getCert(long ulIndexAll) throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_Certificates_getCert__SWIG_0(swigCPtr, this, ulIndexAll), false);
  }

  public String getExternalCertData(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertData(swigCPtr, this, cert);
  }

  public int getExternalCertDataSize(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertDataSize(swigCPtr, this, cert);
  }

  public String getExternalCertSubject(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertSubject(swigCPtr, this, cert);
  }

  public String getExternalCertIssuer(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertIssuer(swigCPtr, this, cert);
  }

  public String getExternalCertNotBefore(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertNotBefore(swigCPtr, this, cert);
  }

  public String getExternalCertNotAfter(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertNotAfter(swigCPtr, this, cert);
  }

  public long getExternalCertKeylenght(int cert) {
    return pteidlibJava_WrapperJNI.PTEID_Certificates_getExternalCertKeylenght(swigCPtr, this, cert);
  }

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

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

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

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

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

  public PTEID_Certificate addCertificate(PTEID_ByteArray cert) throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_Certificates_addCertificate(swigCPtr, this, PTEID_ByteArray.getCPtr(cert), cert), false);
  }

}
