> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:muscle-
> [EMAIL PROTECTED] On Behalf Of Karsten Ohme
> Sent: Wednesday, August 31, 2005 11:04 AM
> To: MUSCLE
> Subject: Re: [Muscle] Win32 libmusclecard and Muscle CSP
>
> Peter Williams wrote:
> > I think we should change the applet. Have it do a default format (e.g.
> 8k,
> > and open acls), in the applet initialization. If the install parameters
> have
> > a magic value, don't do the format, and let the muscletool do it during
> > personalization.
>
> To clarify this, you propose a solution, where if a given parameter at
> load time is set, the applet initializes itself with some default
> settings, so that it can be used without the necessity to format it?
>
> Karsten
Yup. Find mine below, switched using #defines. Need to make the code switch
on a byte in bArray. With doFormat by default.
private JAVA_APPLET (byte[] bArray, short bOffset,byte bLength){
#ifdef OPTION_GP
secureChannel =
JCSystem.makeTransientByteArray((short)1,JCSystem.CLEAR_ON_DESELECT);
#endif
#ifndef USE_NOSETUP
#if 0
PIN_INIT_VALUE = new byte[8];
/* Muscle00 satisfies all current policies (if charset allows it) */
PIN_INIT_VALUE[0] = (byte)'M';
PIN_INIT_VALUE[1] = (byte)'u';
PIN_INIT_VALUE[2] = (byte)'s';
PIN_INIT_VALUE[3] = (byte)'c';
PIN_INIT_VALUE[4] = (byte)'l';
PIN_INIT_VALUE[5] = (byte)'e';
PIN_INIT_VALUE[6] = (byte)'0';
PIN_INIT_VALUE[7] = (byte)'0';
#endif
/* If init pin code does not satisfy policies, internal error */
if (!CheckPINPolicy(PIN_INIT_VALUE, (short) 0, (byte)
PIN_INIT_VALUE.length))
ISOException.throwIt(SW_INTERNAL_ERROR);
ublk_pins = new OwnerPIN[MAX_NUM_PINS];
pins = new OwnerPIN[MAX_NUM_PINS];
// TODO: pass in starting PIN setting with instantiation
/* Setting initial PIN n.0 value */
pins[0] = new OwnerPIN((byte) 3, pinMaxSize);
pins[0].update(PIN_INIT_VALUE, (short) 0, (byte)
PIN_INIT_VALUE.length);
#else
mem = new MemoryManager((short) USE_NOSETUP);
om = new ObjectManager(mem);
..
setupDone = true;
#ifdef USE_CRYPTO
keys = new Key[MAX_NUM_KEYS];
keyACLs = new byte[(short) (MAX_NUM_KEYS * KEY_ACL_SIZE)];
keyPairs = new KeyPair[MAX_NUM_KEYS];
ciphers = new Cipher[MAX_NUM_KEYS];
signatures = new Signature[MAX_NUM_KEYS];
ciph_dirs = new byte[MAX_NUM_KEYS];
for (byte i = (byte) 0; i < (byte) MAX_NUM_KEYS; i++)
ciph_dirs[i] = (byte) 0xFF;
#endif
#ifdef USE_AUTH
getChallengeDone = false; // No GetChallenge() issued so far
randomData = null; // Will be created on demand when
needed
#ifdef WITH_EXT_AUTH
keyTries = new byte[MAX_NUM_KEYS];
for (byte i = (byte) 0; i < (byte) MAX_NUM_KEYS; i++)
keyTries[i] = MAX_KEY_TRIES;
#endif
#endif
logged_ids = 0x00; // No identities logged in
#endif
#ifdef USE_SHARE
elbAppletAID = new AID(bArray,bOffset,bLength);
#endif
} // end of the constructo
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle