xltJIop

16:55:00.256 INFO  jd.cli.Main - Decompiling xltJIop.jar
package com.axalto.iop;

public class UnknownException
  extends xltException
{
  public UnknownException(long paramLong, String paramString)
  {
    super(0L, paramLong, paramString);
  }
  
  public UnknownException(long paramLong)
  {
    super(0L, paramLong, null);
  }
  
  public UnknownException()
  {
    super(0L, 0L, null);
  }
  
  public String getMessage()
  {
    return "Native IOP Library Error of unknown origin: " + super.getMessage();
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.UnknownException
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class FileHeader
{
  int file_size;
  int file_id;
  short file_type;
  short file_status;
  short nb_sub_dir;
  short nb_file;
  short[] access_cond;
  short[] applicationID;
  short[] cryptoflexACL;
  public static final short DIRECTORY = 16;
  public static final short BINARY_FILE = 32;
  public static final short CYCLIC_FILE = 48;
  public static final short VARIABLE_RECORD_FILE = 64;
  public static final short FIXED_RECORD_FILE = 80;
  public static final short INSTANCE = 96;
  public static final short PROGRAM_FILE = 112;
  public static final short UNKNOWN = 0;
  
  public FileHeader()
  {
    setFileSize(0);
    setFileID(0);
    setFileType(0);
    setFileStatus(0);
    setNumSubDirs(0);
    setNumFiles(0);
    applicationID = new short[0];
    int[] arrayOfInt1 = new int[8];
    setACL(arrayOfInt1);
    int[] arrayOfInt2 = new int[7];
    setCryptoflexACL(arrayOfInt2);
  }
  
  public FileHeader(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int[] paramArrayOfInt1, int[] paramArrayOfInt2, int[] paramArrayOfInt3)
  {
    setFileSize(paramInt1);
    setFileID(paramInt2);
    setFileType(paramInt3);
    setFileStatus(paramInt4);
    setNumSubDirs(paramInt5);
    setNumFiles(paramInt6);
    setACL(paramArrayOfInt1);
    setApplicationID(paramArrayOfInt2);
    setCryptoflexACL(paramArrayOfInt3);
  }
  
  public int getFileSize()
  {
    return file_size;
  }
  
  public int getFileID()
  {
    return file_id;
  }
  
  public int getFileType()
  {
    return file_type;
  }
  
  public int getFileStatus()
  {
    return file_status;
  }
  
  public int getNumSubDirs()
  {
    if ((file_type == 16) || (file_type == 96)) {
      return nb_sub_dir;
    }
    return 0;
  }
  
  public int getNumFiles()
  {
    if ((file_type == 16) || (file_type == 96)) {
      return nb_file;
    }
    return 0;
  }
  
  public int getNumRecords()
  {
    if ((file_type == 48) || (file_type == 80) || (file_type == 64)) {
      return nb_file;
    }
    return 0;
  }
  
  public int getRecordLength()
  {
    if ((file_type == 48) || (file_type == 80)) {
      return nb_file;
    }
    return 0;
  }
  
  public int[] getACL()
  {
    if (access_cond == null) {
      return null;
    }
    int[] arrayOfInt = new int[8];
    for (int i = 0; i < 8; i++) {
      arrayOfInt[i] = access_cond[i];
    }
    return arrayOfInt;
  }
  
  public int[] getCryptoflexACL()
  {
    if (cryptoflexACL == null) {
      return null;
    }
    int[] arrayOfInt = new int[7];
    for (int i = 0; i < 7; i++) {
      arrayOfInt[i] = cryptoflexACL[i];
    }
    return arrayOfInt;
  }
  
  public int[] getApplicationID()
  {
    if (applicationID == null) {
      return null;
    }
    int[] arrayOfInt = new int[applicationID.length];
    for (int i = 0; i < applicationID.length; i++) {
      arrayOfInt[i] = applicationID[i];
    }
    return arrayOfInt;
  }
  
  public String getFileTypeName()
  {
    switch (file_type)
    {
    case 16: 
      return "directory";
    case 32: 
      return "binary file";
    case 48: 
      return "cyclic file";
    case 80: 
      return "fixed record file";
    case 96: 
      return "program instance file";
    case 64: 
      return "variable record file";
    case 112: 
      return "program file";
    }
    return "unknown file";
  }
  
  public boolean setFileSize(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 65535))
    {
      file_size = 0;
      return false;
    }
    file_size = paramInt;
    return true;
  }
  
  public boolean setFileID(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 65535))
    {
      file_id = 0;
      return false;
    }
    file_id = paramInt;
    return true;
  }
  
  public boolean setFileType(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 255))
    {
      file_type = 0;
      return false;
    }
    file_type = ((short)paramInt);
    return true;
  }
  
  public boolean setFileStatus(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 255))
    {
      file_status = 0;
      return false;
    }
    file_status = ((short)paramInt);
    return true;
  }
  
  public boolean setNumSubDirs(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 255))
    {
      nb_sub_dir = 0;
      return false;
    }
    nb_sub_dir = ((short)paramInt);
    return true;
  }
  
  public boolean setNumFiles(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 255))
    {
      nb_file = 0;
      return false;
    }
    nb_file = ((short)paramInt);
    return true;
  }
  
  public boolean setACL(int[] paramArrayOfInt)
  {
    if (paramArrayOfInt.length != 8)
    {
      access_cond = new short[8];
      for (i = 0; i < 8; i++) {
        access_cond[i] = 0;
      }
      return false;
    }
    access_cond = new short[8];
    for (int i = 0; i < 8; i++)
    {
      if ((paramArrayOfInt[i] < 0) || (paramArrayOfInt[i] > 255))
      {
        access_cond = new short[8];
        for (i = 0; i < 8; i++) {
          access_cond[i] = 0;
        }
        return false;
      }
      access_cond[i] = ((short)paramArrayOfInt[i]);
    }
    return true;
  }
  
  public boolean setCryptoflexACL(int[] paramArrayOfInt)
  {
    if (paramArrayOfInt.length != 7)
    {
      cryptoflexACL = new short[7];
      for (i = 0; i < 7; i++) {
        cryptoflexACL[i] = 0;
      }
      return false;
    }
    cryptoflexACL = new short[7];
    for (int i = 0; i < 7; i++)
    {
      if ((paramArrayOfInt[i] < 0) || (paramArrayOfInt[i] > 255))
      {
        cryptoflexACL = new short[7];
        for (i = 0; i < 7; i++) {
          cryptoflexACL[i] = 0;
        }
        return false;
      }
      cryptoflexACL[i] = ((short)paramArrayOfInt[i]);
    }
    return true;
  }
  
  public boolean setApplicationID(int[] paramArrayOfInt)
  {
    if (paramArrayOfInt.length > 16)
    {
      applicationID = new short[0];
      return false;
    }
    applicationID = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if ((paramArrayOfInt[i] < 0) || (paramArrayOfInt[i] > 255))
      {
        applicationID = new short[0];
        return false;
      }
      applicationID[i] = ((short)paramArrayOfInt[i]);
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.FileHeader
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

import java.util.Vector;

public class IOP
{
  protected long IOP_ptr;
  private Vector iopListeners = new Vector();
  
  static
  {
    System.loadLibrary("xltjiop");
  }
  
  public IOP()
  {
    getNewIOP();
  }
  
  protected void finalize()
    throws Throwable
  {
    super.finalize();
    freeIOP();
  }
  
  protected native void getNewIOP();
  
  public native void freeIOP();
  
  public native boolean Connect(SmartCard paramSmartCard, String paramString, boolean paramBoolean);
  
  public boolean Connect(SmartCard paramSmartCard, String paramString)
  {
    return Connect(paramSmartCard, paramString, false);
  }
  
  public native boolean Disconnect(SmartCard paramSmartCard);
  
  public native String[] ListReaders();
  
  public native String[] ListKnownCards();
  
  public synchronized void addIOPListener(IOPListener paramIOPListener)
  {
    if (iopListeners.contains(paramIOPListener)) {
      return;
    }
    iopListeners.addElement(paramIOPListener);
  }
  
  public synchronized void removeIOPListener(IOPListener paramIOPListener)
  {
    if (iopListeners.removeElement(paramIOPListener)) {}
  }
  
  public void cardInsertedEvent(String paramString)
  {
    int i = 0;
    fireCardInserted(paramString);
  }
  
  public void cardRemovedEvent(String paramString)
  {
    int i = 0;
    fireCardRemoved(paramString);
  }
  
  private void fireCardInserted(String paramString)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)iopListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    IOPEvent localIOPEvent = new IOPEvent(this);
    localIOPEvent.setReaderName(paramString);
    for (int j = 0; j < i; j++)
    {
      IOPListener localIOPListener = (IOPListener)localVector.elementAt(j);
      localIOPListener.CardInserted(localIOPEvent);
    }
  }
  
  private void fireCardRemoved(String paramString)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)iopListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    IOPEvent localIOPEvent = new IOPEvent(this);
    localIOPEvent.setReaderName(paramString);
    for (int j = 0; j < i; j++)
    {
      IOPListener localIOPListener = (IOPListener)localVector.elementAt(j);
      localIOPListener.CardRemoved(localIOPEvent);
    }
  }
  
  public void readerInsertedEvent(String paramString)
  {
    int i = 0;
    fireReaderInserted(paramString);
  }
  
  public void readerRemovedEvent(String paramString)
  {
    int i = 0;
    fireReaderRemoved(paramString);
  }
  
  private void fireReaderInserted(String paramString)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)iopListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    IOPEvent localIOPEvent = new IOPEvent(this);
    localIOPEvent.setReaderName(paramString);
    for (int j = 0; j < i; j++)
    {
      IOPListener localIOPListener = (IOPListener)localVector.elementAt(j);
      localIOPListener.ReaderInserted(localIOPEvent);
    }
  }
  
  private void fireReaderRemoved(String paramString)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)iopListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    IOPEvent localIOPEvent = new IOPEvent(this);
    localIOPEvent.setReaderName(paramString);
    for (int j = 0; j < i; j++)
    {
      IOPListener localIOPListener = (IOPListener)localVector.elementAt(j);
      localIOPListener.ReaderRemoved(localIOPEvent);
    }
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.IOP
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

import java.util.EventObject;

public class IOPEvent
  extends EventObject
{
  private String ReaderName;
  
  public IOPEvent(IOP paramIOP)
  {
    super(paramIOP);
  }
  
  public void setReaderName(String paramString)
  {
    ReaderName = paramString;
  }
  
  public String getReaderName()
  {
    return ReaderName;
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.IOPEvent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class IOPException
  extends xltException
{
  public IOPException(long paramLong, String paramString)
  {
    super(1L, paramLong, paramString);
  }
  
  public IOPException(long paramLong)
  {
    super(1L, paramLong, null);
  }
  
  public IOPException()
  {
    super(1L, 0L, null);
  }
  
  public String getMessage()
  {
    return "IOP Error: " + super.getMessage();
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.IOPException
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

import java.util.EventListener;

public abstract interface IOPListener
  extends EventListener
{
  public abstract void CardRemoved(IOPEvent paramIOPEvent);
  
  public abstract void CardInserted(IOPEvent paramIOPEvent);
  
  public abstract void ReaderRemoved(IOPEvent paramIOPEvent);
  
  public abstract void ReaderInserted(IOPEvent paramIOPEvent);
}

/* Location:
 * Qualified Name:     com.axalto.iop.IOPListener
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class OSException
  extends xltException
{
  public OSException(long paramLong, String paramString)
  {
    super(2L, paramLong, paramString);
  }
  
  public OSException(long paramLong)
  {
    super(2L, paramLong, null);
  }
  
  public OSException()
  {
    super(2L, 0L, null);
  }
  
  public String getMessage()
  {
    return "Operating System Error: " + super.getMessage();
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.OSException
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class PKIException
  extends xltException
{
  public PKIException(long paramLong, String paramString)
  {
    super(5L, paramLong, paramString);
  }
  
  public PKIException(long paramLong)
  {
    super(5L, paramLong, null);
  }
  
  public PKIException()
  {
    super(5L, 0L, null);
  }
  
  public String getMessage()
  {
    return "PKI Error: " + super.getMessage();
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.PKIException
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class PrivateKeyBlob
{
  short[] P;
  short[] Q;
  short[] InvQ;
  short[] KsecModQ;
  short[] KsecModP;
  
  public PrivateKeyBlob()
  {
    P = new short[0];
    Q = new short[0];
    InvQ = new short[0];
    KsecModQ = new short[0];
    KsecModP = new short[0];
  }
  
  public PrivateKeyBlob(short[] paramArrayOfShort1, short[] paramArrayOfShort2, short[] paramArrayOfShort3, short[] paramArrayOfShort4, short[] paramArrayOfShort5)
  {
    setP(paramArrayOfShort1);
    setQ(paramArrayOfShort2);
    setInvQ(paramArrayOfShort3);
    setKsecModQ(paramArrayOfShort5);
    setKsecModP(paramArrayOfShort4);
  }
  
  public short[] getP()
  {
    if (P == null) {
      return null;
    }
    short[] arrayOfShort = new short[P.length];
    System.arraycopy(P, 0, arrayOfShort, 0, P.length);
    return arrayOfShort;
  }
  
  public short[] getQ()
  {
    if (Q == null) {
      return null;
    }
    short[] arrayOfShort = new short[Q.length];
    System.arraycopy(Q, 0, arrayOfShort, 0, Q.length);
    return arrayOfShort;
  }
  
  public short[] getInvQ()
  {
    if (InvQ == null) {
      return null;
    }
    short[] arrayOfShort = new short[InvQ.length];
    System.arraycopy(InvQ, 0, arrayOfShort, 0, InvQ.length);
    return arrayOfShort;
  }
  
  public short[] getKsecModP()
  {
    if (KsecModP == null) {
      return null;
    }
    short[] arrayOfShort = new short[KsecModP.length];
    System.arraycopy(KsecModP, 0, arrayOfShort, 0, KsecModP.length);
    return arrayOfShort;
  }
  
  public short[] getKsecModQ()
  {
    if (KsecModQ == null) {
      return null;
    }
    short[] arrayOfShort = new short[KsecModQ.length];
    System.arraycopy(KsecModQ, 0, arrayOfShort, 0, KsecModQ.length);
    return KsecModQ;
  }
  
  public boolean setP(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 64)
    {
      P = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        P = new short[0];
        return false;
      }
    }
    P = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, P, 0, paramArrayOfShort.length);
    return true;
  }
  
  public boolean setQ(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 64)
    {
      Q = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        Q = new short[0];
        return false;
      }
    }
    Q = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, Q, 0, paramArrayOfShort.length);
    return true;
  }
  
  public boolean setInvQ(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 64)
    {
      InvQ = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        InvQ = new short[0];
        return false;
      }
    }
    InvQ = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, InvQ, 0, paramArrayOfShort.length);
    return true;
  }
  
  public boolean setKsecModP(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 64)
    {
      KsecModP = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        KsecModP = new short[0];
        return false;
      }
    }
    KsecModP = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, KsecModP, 0, paramArrayOfShort.length);
    return true;
  }
  
  public boolean setKsecModQ(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 64)
    {
      KsecModQ = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        KsecModQ = new short[0];
        return false;
      }
    }
    KsecModQ = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, KsecModQ, 0, paramArrayOfShort.length);
    return true;
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.PrivateKeyBlob
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

public class PublicKeyBlob
{
  short[] Modulus;
  short[] Exponent;
  
  public PublicKeyBlob()
  {
    Modulus = new short[0];
    Exponent = new short[0];
  }
  
  public PublicKeyBlob(short[] paramArrayOfShort1, short[] paramArrayOfShort2)
  {
    setModulus(paramArrayOfShort1);
    setExponent(paramArrayOfShort2);
  }
  
  public short[] getModulus()
  {
    if (Modulus == null) {
      return null;
    }
    short[] arrayOfShort = new short[Modulus.length];
    System.arraycopy(Modulus, 0, arrayOfShort, 0, Modulus.length);
    return arrayOfShort;
  }
  
  public short[] getExponent()
  {
    if (Exponent == null) {
      return null;
    }
    short[] arrayOfShort = new short[Exponent.length];
    System.arraycopy(Exponent, 0, arrayOfShort, 0, Exponent.length);
    return arrayOfShort;
  }
  
  public boolean setModulus(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length > 128)
    {
      Modulus = new short[0];
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        Modulus = new short[0];
        return false;
      }
    }
    Modulus = new short[paramArrayOfShort.length];
    System.arraycopy(paramArrayOfShort, 0, Modulus, 0, paramArrayOfShort.length);
    return true;
  }
  
  public boolean setExponent(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort.length != 4)
    {
      Exponent = new short[4];
      for (i = 0; i < 4; i++) {
        Exponent[i] = 0;
      }
      return false;
    }
    for (int i = 0; i < paramArrayOfShort.length; i++) {
      if ((paramArrayOfShort[i] < 0) || (paramArrayOfShort[i] > 255))
      {
        Exponent = new short[4];
        for (i = 0; i < 4; i++) {
          Exponent[i] = 0;
        }
        return false;
      }
    }
    Exponent = new short[4];
    System.arraycopy(paramArrayOfShort, 0, Exponent, 0, 4);
    return true;
  }
}

/* Location:
 * Qualified Name:     com.axalto.iop.PublicKeyBlob
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.axalto.iop;

import java.util.Vector;

public class SmartCard
{
  long SmartCard_ptr = 1L;
  long SmartCardLockWrap_ptr = 0L;
  protected boolean DataOutOfRange;
  protected boolean CardError;
  protected boolean NullParameter;
  private Vector smartcardListeners = new Vector();
  public static final long SW_MORE_BYTES_AVAILABLE = 24832L;
  public static final long SW_MEMORY_PROBLEM = 25985L;
  public static final long SW_FILE_INVALIDATED = 25219L;
  public static final long SW_KEY_VERIFICATION_FAILED = 25344L;
  public static final long SW_BAD_P3 = 26368L;
  public static final long SW_KEY_NOT_DEFINED = 27009L;
  public static final long SW_KEY_ALGORITHM_MISMATCH = 268462465L;
  public static final long SW_ACCESS_CONDITIONS_NOT_MET = 27010L;
  public static final long SW_KEY_BLOCKED = 27011L;
  public static final long SW_RANDOM_NUMBER_CALL_MISSING = 27013L;
  public static final long SW_DF_OR_EF_NOT_SELECTED = 268462469L;
  public static final long SW_FILE_ID_ALREADY_EXISTS = 27136L;
  public static final long SW_ROOT_DIRECTORY_NOT_ERASABLE = 268462592L;
  public static final long SW_INSTANCE_ID_AREADY_IN_USE = 536898048L;
  public static final long SW_INVALID_PROGRAM_ID = 805333504L;
  public static final long SW_FILE_TYPE_INVALID = 27264L;
  public static final long SW_FILE_NOT_FOUND = 27266L;
  public static final long SW_OUT_OF_SPACE = 27268L;
  public static final long SW_NO_MORE_FILES = 268462724L;
  public static final long SW_OUTSIDE_FILE_BOUNDS = 536898180L;
  public static final long SW_BAD_P1_OR_P2 = 27392L;
  public static final long SW_ALGORITHM_NOT_SUPPORTED = 268462848L;
  public static final long SW_RECORD_INFO_INCOMPATIBLE = 536898304L;
  public static final long SW_BAD_INSTRUCTION_CODE = 27904L;
  public static final long SW_BAD_INSTRUCTION_CLASS = 28160L;
  public static final long SW_UNKNOWN_ERROR = 28416L;
  public static final long SW_DIRECTORY_NOT_EMPTY = 28433L;
  public static final long SW_SUCCESS = 36864L;
  public static final long SW_ACL_NOT_SUPPORTED = 805333760L;
  public static final long SW_BAD_RECORD_LENGTH = 1073769216L;
  public static final long SW_BAD_FILE_PATH = 268462722L;
  public static final long SW_OPERATION_NOT_ACTIVATED = 28437L;
  public static final long SW_ALREADY_ACTIVE = 28441L;
  public static final long SW_SIGNATURE_INVALID = 28434L;
  public static final long SW_INVALID_APPLICATION_STATE = 28436L;
  public static final long SW_CRYPTOGRAPHY_DISABLED = 28442L;
  public static final long SW_DATA_OUT_OF_RANGE = 268463872L;
  public static final long SW_CARD_NOT_INITIALIZED = 536899328L;
  public static final long SW_NULL_PARAMETER = 805334784L;
  public static final long CT_ACCESS_CARD = 2L;
  public static final long CT_CRYPTO_CARD = 1L;
  public static final long CT_UNKNOWN_CARD = 0L;
  
  static
  {
    System.loadLibrary("xltjiop");
  }
  
  public SmartCard()
  {
    ResetErrors();
  }
  
  public synchronized void addSmartCardListener(SmartCardListener paramSmartCardListener)
  {
    if (smartcardListeners.contains(paramSmartCardListener)) {
      return;
    }
    smartcardListeners.addElement(paramSmartCardListener);
  }
  
  public synchronized void removeSmartCardListener(SmartCardListener paramSmartCardListener)
  {
    if (smartcardListeners.removeElement(paramSmartCardListener)) {}
  }
  
  public void sendDataEvent(short[] paramArrayOfShort)
  {
    fireDataSent(paramArrayOfShort);
  }
  
  public void receiveDataEvent(short[] paramArrayOfShort)
  {
    fireDataReceived(paramArrayOfShort);
  }
  
  private void fireDataSent(short[] paramArrayOfShort)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)smartcardListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    SmartCardEvent localSmartCardEvent = new SmartCardEvent(this);
    localSmartCardEvent.setData(paramArrayOfShort);
    for (int j = 0; j < i; j++)
    {
      SmartCardListener localSmartCardListener = (SmartCardListener)localVector.elementAt(j);
      localSmartCardListener.DataSent(localSmartCardEvent);
    }
  }
  
  private void fireDataReceived(short[] paramArrayOfShort)
  {
    Vector localVector;
    synchronized (this)
    {
      localVector = (Vector)smartcardListeners.clone();
    }
    int i = localVector.size();
    if (i == 0) {
      return;
    }
    SmartCardEvent localSmartCardEvent = new SmartCardEvent(this);
    localSmartCardEvent.setData(paramArrayOfShort);
    for (int j = 0; j < i; j++)
    {
      SmartCardListener localSmartCardListener = (SmartCardListener)localVector.elementAt(j);
      localSmartCardListener.DataReceived(localSmartCardEvent);
    }
  }
  
  public short[] SendCardAPDU(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int[] paramArrayOfInt, int paramInt5)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt1)) || (!CheckShortRange(paramInt2)) || (!CheckShortRange(paramInt3)) || (!CheckShortRange(paramInt4)) || (!CheckShortRange(paramInt5)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return null;
    }
    short[] arrayOfShort1 = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return null;
      }
      arrayOfShort1[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    short[] arrayOfShort2;
    try
    {
      arrayOfShort2 = IOPSendCardAPDU((short)paramInt1, (short)paramInt2, (short)paramInt3, (short)paramInt4, arrayOfShort1, (short)paramInt5);
    }
    catch (xltException localxltException)
    {
      if (localxltException.getMessage().regionMatches(true, 0, "Operating System Error: <Code ffffffff80100069> The smart card has been removed, so that further communication is not possible.", 0, 47))
      {
        SmartCard_ptr = 0L;
        SmartCardLockWrap_ptr = 0L;
      }
      throw localxltException;
    }
    return arrayOfShort2;
  }
  
  public String GetErrorMessage()
  {
    if (DataOutOfRange) {
      return "A value passed through the IOP was out of range.  Ensure the values are in the appropriate range (0x00-0xFF or 0x0000 to 0xFFFF) and each array is the proper length.";
    }
    if (CardError) {
      return "The Java SmartCard object was not initialized.  Call IOP::Connect(...) to connect the card and initialize the object.";
    }
    if (NullParameter) {
      return "An object reference passed through the IOP was null.  Ensure each refers to an actual object.";
    }
    return "";
  }
  
  public int GetLastErrorCode()
  {
    CardIsValid();
    if ((DataOutOfRange) || (CardError) || (NullParameter)) {
      return 28416;
    }
    return 36864;
  }
  
  public void ResetCard()
    throws xltException
  {
    if (!CardIsValid()) {
      return;
    }
    ResetErrors();
    IOPResetCard();
  }
  
  public void ReConnect()
    throws xltException
  {
    ResetErrors();
    IOPReConnect();
  }
  
  public short[] GetATR()
    throws xltException
  {
    if (!CardIsValid()) {
      return null;
    }
    ResetErrors();
    return IOPGetATR();
  }
  
  public short[] GetACL()
    throws xltException
  {
    if (!CardIsValid()) {
      return null;
    }
    ResetErrors();
    return IOPGetACL();
  }
  
  public boolean DeleteFile(int paramInt)
    throws xltException
  {
    if (!CardIsValid()) {
      return false;
    }
    if (!CheckIntRange(paramInt)) {
      return false;
    }
    ResetErrors();
    return IOPDeleteFile(paramInt);
  }
  
  public boolean CreateFile(FileHeader paramFileHeader)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramFileHeader))) {
      return false;
    }
    ResetErrors();
    return IOPCreateFile(paramFileHeader);
  }
  
  public boolean SelectParent()
    throws xltException
  {
    if (!CardIsValid()) {
      return false;
    }
    ResetErrors();
    return IOPSelectParent();
  }
  
  public boolean SetCardName(String paramString)
  {
    if (!CardIsValid()) {
      return false;
    }
    ResetErrors();
    IOPSetCardName(paramString);
    return true;
  }
  
  public boolean Directory(int paramInt, FileHeader paramFileHeader)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramFileHeader))) {
      return false;
    }
    ResetErrors();
    return IOPDirectory((short)paramInt, paramFileHeader);
  }
  
  public boolean Select(String paramString, FileHeader paramFileHeader, boolean paramBoolean)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramString))) {
      return false;
    }
    ResetErrors();
    return IOPSelect(paramString, paramFileHeader, paramBoolean);
  }
  
  public boolean Select(String paramString)
    throws xltException
  {
    return Select(paramString, null, false);
  }
  
  public boolean Select(String paramString, FileHeader paramFileHeader)
    throws xltException
  {
    return Select(paramString, paramFileHeader, false);
  }
  
  public boolean Select(String paramString, boolean paramBoolean)
    throws xltException
  {
    return Select(paramString, null, paramBoolean);
  }
  
  public boolean SelectCardlet(int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPSelectCardlet(arrayOfShort);
  }
  
  public boolean ValidateProgram(int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPValidateProgram(arrayOfShort);
  }
  
  public boolean ExecuteInstall(int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPExecuteInstall(arrayOfShort);
  }
  
  public short[] GetResponse(int paramInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt))) {
      return null;
    }
    ResetErrors();
    return IOPGetResponse((short)paramInt);
  }
  
  public short[] ReadRecord(int paramInt1, int paramInt2, int paramInt3)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt1)) || (!CheckShortRange(paramInt2)) || (!CheckShortRange(paramInt3))) {
      return null;
    }
    ResetErrors();
    return IOPReadRecord((short)paramInt1, (short)paramInt2, (short)paramInt3);
  }
  
  public boolean UpdateRecord(int paramInt1, int paramInt2, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt1)) || (!CheckShortRange(paramInt2)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPUpdateRecord((short)paramInt1, (short)paramInt2, arrayOfShort);
  }
  
  public short[] ReadBinary(int paramInt1, int paramInt2)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckIntRange(paramInt1)) || (!CheckIntRange(paramInt2))) {
      return null;
    }
    ResetErrors();
    return IOPReadBinary(paramInt1, paramInt2);
  }
  
  public boolean WriteBinary(int paramInt, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckIntRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckIntRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPWriteBinary(paramInt, arrayOfShort);
  }
  
  public boolean VerifyKey(int paramInt, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPVerifyKey((short)paramInt, arrayOfShort);
  }
  
  public boolean VerifyCHV(int paramInt, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPVerifyCHV((short)paramInt, arrayOfShort);
  }
  
  public boolean VerifyTransportKey(int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPVerifyTransportKey(arrayOfShort);
  }
  
  public short[] GetChallenge(int paramInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt))) {
      return null;
    }
    ResetErrors();
    return IOPGetChallenge((short)paramInt);
  }
  
  public boolean ExternalAuth(int paramInt1, int paramInt2, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt1)) || (!CheckShortRange(paramInt2)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return false;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPExternalAuth((short)paramInt1, (short)paramInt2, arrayOfShort);
  }
  
  public short[] InternalAuth(int paramInt1, int paramInt2, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt1)) || (!CheckShortRange(paramInt2)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return null;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (int i = 0; i < paramArrayOfInt.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt[i])) {
        return null;
      }
      arrayOfShort[i] = ((short)paramArrayOfInt[i]);
    }
    ResetErrors();
    return IOPInternalAuth((short)paramInt1, (short)paramInt2, arrayOfShort);
  }
  
  public boolean ReadPublicKey(PublicKeyBlob paramPublicKeyBlob, int paramInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt))) {
      return false;
    }
    if (paramPublicKeyBlob == null)
    {
      NullParameter = true;
      return false;
    }
    ResetErrors();
    return IOPReadPublicKey(paramPublicKeyBlob, (short)paramInt);
  }
  
  public boolean WritePublicKey(PublicKeyBlob paramPublicKeyBlob, int paramInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt))) {
      return false;
    }
    if (paramPublicKeyBlob == null)
    {
      NullParameter = true;
      return false;
    }
    ResetErrors();
    return IOPWritePublicKey(paramPublicKeyBlob, (short)paramInt);
  }
  
  public boolean WritePrivateKey(PrivateKeyBlob paramPrivateKeyBlob, int paramInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt))) {
      return false;
    }
    if (paramPrivateKeyBlob == null)
    {
      NullParameter = true;
      return false;
    }
    ResetErrors();
    return IOPWritePrivateKey(paramPrivateKeyBlob, (short)paramInt);
  }
  
  public boolean ChangeCHV(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt1)) || (!CheckObjectParameter(paramArrayOfInt2)) || (!CheckShortRange(paramArrayOfInt1.length)) || (!CheckShortRange(paramArrayOfInt2.length))) {
      return false;
    }
    if (paramArrayOfInt1.length != paramArrayOfInt2.length)
    {
      DataOutOfRange = true;
      return false;
    }
    short[] arrayOfShort1 = new short[paramArrayOfInt1.length];
    short[] arrayOfShort2 = new short[paramArrayOfInt2.length];
    for (int i = 0; i < paramArrayOfInt1.length; i++)
    {
      if ((!CheckShortRange(paramArrayOfInt1[i])) || (!CheckShortRange(paramArrayOfInt2[i]))) {
        return false;
      }
      arrayOfShort1[i] = ((short)paramArrayOfInt1[i]);
      arrayOfShort2[i] = ((short)paramArrayOfInt2[i]);
    }
    ResetErrors();
    return IOPChangeCHV((short)paramInt, arrayOfShort1, arrayOfShort2);
  }
  
  public boolean UnblockCHV(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt1)) || (!CheckObjectParameter(paramArrayOfInt2)) || (!CheckShortRange(paramArrayOfInt1.length)) || (!CheckShortRange(paramArrayOfInt2.length))) {
      return false;
    }
    short[] arrayOfShort1 = new short[paramArrayOfInt1.length];
    for (int i = 0; i < paramArrayOfInt1.length; i++)
    {
      if (!CheckShortRange(paramArrayOfInt1[i])) {
        return false;
      }
      arrayOfShort1[i] = ((short)paramArrayOfInt1[i]);
    }
    short[] arrayOfShort2 = new short[paramArrayOfInt2.length];
    for (int j = 0; j < paramArrayOfInt2.length; j++)
    {
      if (!CheckShortRange(paramArrayOfInt2[j])) {
        return false;
      }
      arrayOfShort2[j] = ((short)paramArrayOfInt2[j]);
    }
    ResetErrors();
    return IOPUnblockCHV((short)paramInt, arrayOfShort1, arrayOfShort2);
  }
  
  public boolean ChangeUnblockKey(int paramInt, int[] paramArrayOfInt)
    throws xltException
  {
    if ((!CardIsValid()) || (!CheckShortRange(paramInt)) || (!CheckObjectParameter(paramArrayOfInt)) || (!CheckShortRange(paramArrayOfInt.length))) {
      return false;
    }
    short[] arrayOfShort = new short[paramArrayOfInt.length];
    for (i
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd