com.ibm.jc.tools
Class OPKeyData

java.lang.Object
  extended byStringData
      extended bycom.ibm.jc.tools.OPKeyData

public class OPKeyData
extends StringData

This GetOpt elements parses a OPKey spec. It might either refer to a full APDU or only part of it. The data of the APDU can be specified either in hexadecimal form as as strings. You can mix both representations.

See Also:
Serialized Form

Field Summary
static int KEYDEF
          Parse key definitions (set/id/type/data)
static int KEYREF
          Parse key references (set/id)
static int KEYREFDEF
          Parse key definitions/references
static java.lang.String SYNTAX
           
 
Constructor Summary
OPKeyData(java.lang.String mnemo, java.lang.String description, java.lang.String defaultVal, int mode)
           
 
Method Summary
 OPKey getKey()
           
 int getKeyId()
           
 byte[] getKeyMaterial()
           
 int getKeySet()
           
 int getKeyType()
           
 java.lang.Object getValue()
           
 int parse(java.util.Vector argv, int pos)
           
static byte[] parseKey(java.lang.String s, int[] set_id_type, int mode)
          Parse a string and return a byte array.
 void reset()
           
 void setValue(java.lang.Object o)
           
static java.lang.String toString(OPKey key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEYREFDEF

public static final int KEYREFDEF
Parse key definitions/references

See Also:
Constant Field Values

KEYREF

public static final int KEYREF
Parse key references (set/id)

See Also:
Constant Field Values

KEYDEF

public static final int KEYDEF
Parse key definitions (set/id/type/data)

See Also:
Constant Field Values

SYNTAX

public static final java.lang.String SYNTAX
See Also:
Constant Field Values
Constructor Detail

OPKeyData

public OPKeyData(java.lang.String mnemo,
                 java.lang.String description,
                 java.lang.String defaultVal,
                 int mode)
Method Detail

toString

public static java.lang.String toString(OPKey key)
Returns:
a string representation of the specified key.

parseKey

public static byte[] parseKey(java.lang.String s,
                              int[] set_id_type,
                              int mode)
Parse a string and return a byte array.

Parameters:
s - the string containing either the key reference or defintion
set_id_type - either an array of length 2 or 3. If length 2 then key references are parsed. Index 0 receives key set and index 1 the key id. If length is 3 then parse key definitions. Indices 0 and 1 are as described above. Index 2 receives the key type.
Returns:
the parse key material if set_id_type has length 3. Otherwise return null.

reset

public void reset()

getValue

public java.lang.Object getValue()

setValue

public void setValue(java.lang.Object o)

getKeySet

public int getKeySet()

getKeyId

public int getKeyId()

getKeyType

public int getKeyType()

getKeyMaterial

public byte[] getKeyMaterial()

getKey

public OPKey getKey()

parse

public int parse(java.util.Vector argv,
                 int pos)
          throws GetOptException
Throws:
GetOptException