Esempio n. 1
0
 private PKIApplet() {
   pin = new OwnerPIN(PIN_TRIES, MAX_PIN_SIZE);
   puc = new OwnerPIN(PUC_TRIES, PUC_SIZE);
   rd = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
   pkcs1Cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
   nopadCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
   md = MessageDigest.getInstance(MessageDigest.ALG_SHA, false);
   tmp = JCSystem.makeTransientByteArray(TMP_SIZE, JCSystem.CLEAR_ON_DESELECT);
   state = STATE_INITIAL;
   authKeyId = new byte[KEY_ID_SIZE];
   signKeyId = new byte[KEY_ID_SIZE];
   decKeyId = new byte[KEY_ID_SIZE];
   authKeyPrivate =
       (RSAPrivateCrtKey)
           KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_1024, false);
   signKeyPrivate =
       (RSAPrivateCrtKey)
           KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_1024, false);
   decKeyPrivate =
       (RSAPrivateCrtKey)
           KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_1024, false);
   tempKeyPublic =
       (RSAPublicKey)
           KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC, KeyBuilder.LENGTH_RSA_1024, false);
   currentPrivateKey = JCSystem.makeTransientObjectArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
   expectedDecipherDataLength =
       JCSystem.makeTransientShortArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
   fileSystem = new FileSystem((short) 16);
 }
 private ConnectionManager(byte[] bArray, short bOffset, byte bLength) {
   // The connection manager keeps track of the area where the
   // device is operating.  Since the area changes as the user moves,
   // we keep track of the area by setting a variable in Transient
   // Clear-On-Deselect memory.
   activeAreaCode = JCSystem.makeTransientShortArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
   activeAreaCode[0] = INACTIVE_AREA;
   connectionStatus = JCSystem.makeTransientByteArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
   register();
 }
Esempio n. 3
0
 /**
  * Create a new file system for maxFiles maximum number of files.
  *
  * @param maxFiles the maximum number of files.
  */
 FileSystem(short maxFiles) {
   efFiles = new Object[maxFiles];
   efPerms = new byte[maxFiles];
   fileStructureIndex = JCSystem.makeTransientShortArray((short) 1, JCSystem.CLEAR_ON_DESELECT);
   fnfe = new FileNotFoundException();
 }