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

package com.chilkatsoft;

public class CkJavaKeyStore {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected CkJavaKeyStore(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected static long swigRelease(CkJavaKeyStore obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        chilkatJNI.delete_CkJavaKeyStore(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CkJavaKeyStore() {
    this(chilkatJNI.new_CkJavaKeyStore(), true);
  }

  public void LastErrorXml(CkString str) {
    chilkatJNI.CkJavaKeyStore_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorHtml(CkString str) {
    chilkatJNI.CkJavaKeyStore_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorText(CkString str) {
    chilkatJNI.CkJavaKeyStore_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void get_DebugLogFilePath(CkString str) {
    chilkatJNI.CkJavaKeyStore_get_DebugLogFilePath(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String debugLogFilePath() {
    return chilkatJNI.CkJavaKeyStore_debugLogFilePath(swigCPtr, this);
  }

  public void put_DebugLogFilePath(String newVal) {
    chilkatJNI.CkJavaKeyStore_put_DebugLogFilePath(swigCPtr, this, newVal);
  }

  public void get_LastErrorHtml(CkString str) {
    chilkatJNI.CkJavaKeyStore_get_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorHtml() {
    return chilkatJNI.CkJavaKeyStore_lastErrorHtml(swigCPtr, this);
  }

  public void get_LastErrorText(CkString str) {
    chilkatJNI.CkJavaKeyStore_get_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorText() {
    return chilkatJNI.CkJavaKeyStore_lastErrorText(swigCPtr, this);
  }

  public void get_LastErrorXml(CkString str) {
    chilkatJNI.CkJavaKeyStore_get_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorXml() {
    return chilkatJNI.CkJavaKeyStore_lastErrorXml(swigCPtr, this);
  }

  public boolean get_LastMethodSuccess() {
    return chilkatJNI.CkJavaKeyStore_get_LastMethodSuccess(swigCPtr, this);
  }

  public void put_LastMethodSuccess(boolean newVal) {
    chilkatJNI.CkJavaKeyStore_put_LastMethodSuccess(swigCPtr, this, newVal);
  }

  public int get_NumPrivateKeys() {
    return chilkatJNI.CkJavaKeyStore_get_NumPrivateKeys(swigCPtr, this);
  }

  public int get_NumSecretKeys() {
    return chilkatJNI.CkJavaKeyStore_get_NumSecretKeys(swigCPtr, this);
  }

  public int get_NumTrustedCerts() {
    return chilkatJNI.CkJavaKeyStore_get_NumTrustedCerts(swigCPtr, this);
  }

  public boolean get_RequireCompleteChain() {
    return chilkatJNI.CkJavaKeyStore_get_RequireCompleteChain(swigCPtr, this);
  }

  public void put_RequireCompleteChain(boolean newVal) {
    chilkatJNI.CkJavaKeyStore_put_RequireCompleteChain(swigCPtr, this, newVal);
  }

  public boolean get_VerboseLogging() {
    return chilkatJNI.CkJavaKeyStore_get_VerboseLogging(swigCPtr, this);
  }

  public void put_VerboseLogging(boolean newVal) {
    chilkatJNI.CkJavaKeyStore_put_VerboseLogging(swigCPtr, this, newVal);
  }

  public boolean get_VerifyKeyedDigest() {
    return chilkatJNI.CkJavaKeyStore_get_VerifyKeyedDigest(swigCPtr, this);
  }

  public void put_VerifyKeyedDigest(boolean newVal) {
    chilkatJNI.CkJavaKeyStore_put_VerifyKeyedDigest(swigCPtr, this, newVal);
  }

  public void get_Version(CkString str) {
    chilkatJNI.CkJavaKeyStore_get_Version(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String version() {
    return chilkatJNI.CkJavaKeyStore_version(swigCPtr, this);
  }

  public boolean AddPfx(CkPfx pfx, String alias, String password) {
    return chilkatJNI.CkJavaKeyStore_AddPfx(swigCPtr, this, CkPfx.getCPtr(pfx), pfx, alias, password);
  }

  public boolean AddPrivateKey(CkCert cert, String alias, String password) {
    return chilkatJNI.CkJavaKeyStore_AddPrivateKey(swigCPtr, this, CkCert.getCPtr(cert), cert, alias, password);
  }

  public boolean AddSecretKey(String encodedKeyBytes, String encoding, String algorithm, String alias, String password) {
    return chilkatJNI.CkJavaKeyStore_AddSecretKey(swigCPtr, this, encodedKeyBytes, encoding, algorithm, alias, password);
  }

  public boolean AddTrustedCert(CkCert cert, String alias) {
    return chilkatJNI.CkJavaKeyStore_AddTrustedCert(swigCPtr, this, CkCert.getCPtr(cert), cert, alias);
  }

  public boolean CertChainAt(int index, CkCertChain certChain) {
    return chilkatJNI.CkJavaKeyStore_CertChainAt(swigCPtr, this, index, CkCertChain.getCPtr(certChain), certChain);
  }

  public boolean CertChainOf(String alias, boolean caseSensitive, CkCertChain certChain) {
    return chilkatJNI.CkJavaKeyStore_CertChainOf(swigCPtr, this, alias, caseSensitive, CkCertChain.getCPtr(certChain), certChain);
  }

  public boolean ChangePassword(int index, String oldPassword, String newPassword) {
    return chilkatJNI.CkJavaKeyStore_ChangePassword(swigCPtr, this, index, oldPassword, newPassword);
  }

  public CkCertChain FindCertChain(String alias, boolean caseSensitive) {
    long cPtr = chilkatJNI.CkJavaKeyStore_FindCertChain(swigCPtr, this, alias, caseSensitive);
    return (cPtr == 0) ? null : new CkCertChain(cPtr, true);
  }

  public CkPrivateKey FindPrivateKey(String password, String alias, boolean caseSensitive) {
    long cPtr = chilkatJNI.CkJavaKeyStore_FindPrivateKey(swigCPtr, this, password, alias, caseSensitive);
    return (cPtr == 0) ? null : new CkPrivateKey(cPtr, true);
  }

  public CkCert FindTrustedCert(String alias, boolean caseSensitive) {
    long cPtr = chilkatJNI.CkJavaKeyStore_FindTrustedCert(swigCPtr, this, alias, caseSensitive);
    return (cPtr == 0) ? null : new CkCert(cPtr, true);
  }

  public CkCertChain GetCertChain(int index) {
    long cPtr = chilkatJNI.CkJavaKeyStore_GetCertChain(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CkCertChain(cPtr, true);
  }

  public CkPrivateKey GetPrivateKey(String password, int index) {
    long cPtr = chilkatJNI.CkJavaKeyStore_GetPrivateKey(swigCPtr, this, password, index);
    return (cPtr == 0) ? null : new CkPrivateKey(cPtr, true);
  }

  public boolean GetPrivateKeyAlias(int index, CkString outStr) {
    return chilkatJNI.CkJavaKeyStore_GetPrivateKeyAlias(swigCPtr, this, index, CkString.getCPtr(outStr), outStr);
  }

  public String getPrivateKeyAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_getPrivateKeyAlias(swigCPtr, this, index);
  }

  public String privateKeyAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_privateKeyAlias(swigCPtr, this, index);
  }

  public boolean GetSecretKey(String password, int index, String encoding, CkString outStr) {
    return chilkatJNI.CkJavaKeyStore_GetSecretKey(swigCPtr, this, password, index, encoding, CkString.getCPtr(outStr), outStr);
  }

  public String getSecretKey(String password, int index, String encoding) {
    return chilkatJNI.CkJavaKeyStore_getSecretKey(swigCPtr, this, password, index, encoding);
  }

  public String secretKey(String password, int index, String encoding) {
    return chilkatJNI.CkJavaKeyStore_secretKey(swigCPtr, this, password, index, encoding);
  }

  public boolean GetSecretKeyAlias(int index, CkString outStr) {
    return chilkatJNI.CkJavaKeyStore_GetSecretKeyAlias(swigCPtr, this, index, CkString.getCPtr(outStr), outStr);
  }

  public String getSecretKeyAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_getSecretKeyAlias(swigCPtr, this, index);
  }

  public String secretKeyAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_secretKeyAlias(swigCPtr, this, index);
  }

  public CkCert GetTrustedCert(int index) {
    long cPtr = chilkatJNI.CkJavaKeyStore_GetTrustedCert(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CkCert(cPtr, true);
  }

  public boolean GetTrustedCertAlias(int index, CkString outStr) {
    return chilkatJNI.CkJavaKeyStore_GetTrustedCertAlias(swigCPtr, this, index, CkString.getCPtr(outStr), outStr);
  }

  public String getTrustedCertAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_getTrustedCertAlias(swigCPtr, this, index);
  }

  public String trustedCertAlias(int index) {
    return chilkatJNI.CkJavaKeyStore_trustedCertAlias(swigCPtr, this, index);
  }

  public boolean LoadBd(String password, CkBinData bd) {
    return chilkatJNI.CkJavaKeyStore_LoadBd(swigCPtr, this, password, CkBinData.getCPtr(bd), bd);
  }

  public boolean LoadBinary(String password, CkByteData jksData) {
    return chilkatJNI.CkJavaKeyStore_LoadBinary(swigCPtr, this, password, CkByteData.getCPtr(jksData), jksData);
  }

  public boolean LoadEncoded(String password, String jksEncData, String encoding) {
    return chilkatJNI.CkJavaKeyStore_LoadEncoded(swigCPtr, this, password, jksEncData, encoding);
  }

  public boolean LoadFile(String password, String path) {
    return chilkatJNI.CkJavaKeyStore_LoadFile(swigCPtr, this, password, path);
  }

  public boolean LoadJwkSet(String password, CkJsonObject jwkSet) {
    return chilkatJNI.CkJavaKeyStore_LoadJwkSet(swigCPtr, this, password, CkJsonObject.getCPtr(jwkSet), jwkSet);
  }

  public boolean PrivateKeyAt(String password, int index, CkPrivateKey privKey) {
    return chilkatJNI.CkJavaKeyStore_PrivateKeyAt(swigCPtr, this, password, index, CkPrivateKey.getCPtr(privKey), privKey);
  }

  public boolean PrivateKeyOf(String password, String alias, boolean caseSensitive, CkPrivateKey privKey) {
    return chilkatJNI.CkJavaKeyStore_PrivateKeyOf(swigCPtr, this, password, alias, caseSensitive, CkPrivateKey.getCPtr(privKey), privKey);
  }

  public boolean RemoveEntry(int entryType, int index) {
    return chilkatJNI.CkJavaKeyStore_RemoveEntry(swigCPtr, this, entryType, index);
  }

  public boolean SetAlias(int entryType, int index, String alias) {
    return chilkatJNI.CkJavaKeyStore_SetAlias(swigCPtr, this, entryType, index, alias);
  }

  public boolean ToBd(String password, CkBinData bd) {
    return chilkatJNI.CkJavaKeyStore_ToBd(swigCPtr, this, password, CkBinData.getCPtr(bd), bd);
  }

  public boolean ToBinary(String password, CkByteData outBytes) {
    return chilkatJNI.CkJavaKeyStore_ToBinary(swigCPtr, this, password, CkByteData.getCPtr(outBytes), outBytes);
  }

  public boolean ToEncodedString(String password, String encoding, CkString outStr) {
    return chilkatJNI.CkJavaKeyStore_ToEncodedString(swigCPtr, this, password, encoding, CkString.getCPtr(outStr), outStr);
  }

  public String toEncodedString(String password, String encoding) {
    return chilkatJNI.CkJavaKeyStore_toEncodedString(swigCPtr, this, password, encoding);
  }

  public boolean ToFile(String password, String path) {
    return chilkatJNI.CkJavaKeyStore_ToFile(swigCPtr, this, password, path);
  }

  public boolean ToJwkSet(String password, CkStringBuilder sbJwkSet) {
    return chilkatJNI.CkJavaKeyStore_ToJwkSet(swigCPtr, this, password, CkStringBuilder.getCPtr(sbJwkSet), sbJwkSet);
  }

  public CkPem ToPem(String password) {
    long cPtr = chilkatJNI.CkJavaKeyStore_ToPem(swigCPtr, this, password);
    return (cPtr == 0) ? null : new CkPem(cPtr, true);
  }

  public boolean ToPemObj(String password, CkPem pemObj) {
    return chilkatJNI.CkJavaKeyStore_ToPemObj(swigCPtr, this, password, CkPem.getCPtr(pemObj), pemObj);
  }

  public CkPfx ToPfx(String password) {
    long cPtr = chilkatJNI.CkJavaKeyStore_ToPfx(swigCPtr, this, password);
    return (cPtr == 0) ? null : new CkPfx(cPtr, true);
  }

  public boolean ToPfxObj(String password, CkPfx pfxObj) {
    return chilkatJNI.CkJavaKeyStore_ToPfxObj(swigCPtr, this, password, CkPfx.getCPtr(pfxObj), pfxObj);
  }

  public boolean TrustedCertAt(int index, CkCert cert) {
    return chilkatJNI.CkJavaKeyStore_TrustedCertAt(swigCPtr, this, index, CkCert.getCPtr(cert), cert);
  }

  public boolean TrustedCertOf(String alias, boolean caseSensitive, CkCert cert) {
    return chilkatJNI.CkJavaKeyStore_TrustedCertOf(swigCPtr, this, alias, caseSensitive, CkCert.getCPtr(cert), cert);
  }

  public boolean UseCertVault(CkXmlCertVault vault) {
    return chilkatJNI.CkJavaKeyStore_UseCertVault(swigCPtr, this, CkXmlCertVault.getCPtr(vault), vault);
  }

}
