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

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

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

  public String getLabel() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getLabel(swigCPtr, this);
  }

  public long getID() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getID(swigCPtr, this);
  }

  public PTEID_CertifStatus getStatus() {
    return PTEID_CertifStatus.swigToEnum(pteidlibJava_WrapperJNI.PTEID_Certificate_getStatus(swigCPtr, this));
  }

  public PTEID_CertifType getType() throws PTEID_Exception {
    return PTEID_CertifType.swigToEnum(pteidlibJava_WrapperJNI.PTEID_Certificate_getType(swigCPtr, this));
  }

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

  public void getFormattedData(PTEID_ByteArray data) {
    pteidlibJava_WrapperJNI.PTEID_Certificate_getFormattedData(swigCPtr, this, PTEID_ByteArray.getCPtr(data), data);
  }

  public String getSerialNumber() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getSerialNumber(swigCPtr, this);
  }

  public String getOwnerName() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getOwnerName(swigCPtr, this);
  }

  public String getIssuerName() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getIssuerName(swigCPtr, this);
  }

  public String getValidityBegin() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getValidityBegin(swigCPtr, this);
  }

  public String getValidityEnd() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getValidityEnd(swigCPtr, this);
  }

  public long getKeyLength() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_getKeyLength(swigCPtr, this);
  }

  public boolean isRoot() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_isRoot(swigCPtr, this);
  }

  public boolean isTest() {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_isTest(swigCPtr, this);
  }

  public boolean isFromPteidValidChain() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_isFromPteidValidChain(swigCPtr, this);
  }

  public boolean isFromCard() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_isFromCard(swigCPtr, this);
  }

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

  public long countChildren() throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Certificate_countChildren(swigCPtr, this);
  }

  public PTEID_Certificate getChildren(long ulIndex) throws PTEID_Exception {
    return new PTEID_Certificate(pteidlibJava_WrapperJNI.PTEID_Certificate_getChildren(swigCPtr, this, ulIndex), false);
  }

  public final static long CITIZEN_AUTH = pteidlibJava_WrapperJNI.PTEID_Certificate_CITIZEN_AUTH_get();
  public final static long CITIZEN_SIGN = pteidlibJava_WrapperJNI.PTEID_Certificate_CITIZEN_SIGN_get();
  public final static long SUB_CA_SIGN = pteidlibJava_WrapperJNI.PTEID_Certificate_SUB_CA_SIGN_get();
  public final static long SUB_CA_AUTH = pteidlibJava_WrapperJNI.PTEID_Certificate_SUB_CA_AUTH_get();
}
