FileDocCategorySizeDatePackage
PhotoCard.javaAPI DocJava Card5518Wed Mar 22 21:07:24 GMT 2006com.sun.javacard.samples.photocard

PhotoCard

public interface PhotoCard implements Remote
PhotoCard interface Defines methods to be used as interface between photo client and storage smart card

Fields Summary
public static final short
NO_SPACE_AVAILABLE
No space available for photo storage
public static final short
NO_PHOTO_STORED
No photo stored in selected location
public static final short
INVALID_PHOTO_ID
Invalid photo ID
public static final short
INVALID_ARGUMENT
Invalid argument value
public static final short
MAX_SIZE
Maximum photo size
public static final short
MAX_PHOTO_COUNT
Maximum on-card photos
public static final short
MAX_BUFFER_BYTES
Maximum bytes for transfer
public static final short
INVALID_OFFSET
public static final short
DOES_NOT_SUPPORT_PHOTO_VERIFICTAION
SHA256 MessageDisgest implementation not provided
public static final short
FAIL1
public static final short
FAIL2
public static final short
FAIL3
threw wrong exception
public static final short
FAIL4
Constructors Summary
Methods Summary
public voiddeletePhoto(short photoID)
This method deletes the photo whose ID is specified in the card.

param
photoID - ID slot of photo to delete
exception
UserException - thrown if error condition occurs, or invalid parameters passed.

public byte[]getPhoto(short photoID, short offset, short size)
This method retrueves a series of bytes belonging to the photo from the smart card at the position specified.

param
photoID - photo slot where to store data
param
size - number of bytes expected from the smart card
param
offset - position inside photo buffer where to access data.
return
byte array with binary data from photo stored inside the smart card
exception
UserException - thrown if error condition occurs, or invalid parameters passed.

public shortgetPhotoSize(short photoID)
This method retrieves the photo size whose ID is specified.

param
photoID - ID slot of photo to access
exception
UserException - thrown if error condition occurs, or invalid parameters passed.

public voidloadPhoto(short photoID, byte[] data, short size, short offset, boolean more)
This method loads a series of bytes belonging to the photo into the smart card at the position specified.

param
photoID - photo slot where to store data
param
data - byte array contaiing binary photo information
param
size - number of bytes being passed into the smart card
param
offset - position inside photo buffer where to store data.
boolean
more - true indicates more data coming; false inidicates this is the last data chunk.
exception
UserException - thrown if error condition occurs, or invalid parameters passed.

public shortrequestPhotoStorage(short size)
This method requests the smart card to allocate space to store a photo image of the specified size.

param
size - Image size to store in the smart card
return
photoID - ID slot in card where photo will be stored
exception
UserException - thrown if error condition occurs, or invalid parameters passed.

public shortverifyPhoto(short photoID, byte[] photoDigest, short photoOffset)
This method verifies on card the photo presented by the user.

param
photoID - photo slot where to store data
param
size - number of bytes expected from the smart card
param
offset - position inside photo buffer where to access data.
param
photoDigest - msg digest of photo sent by user
param
photoOffset - position inside photoDigest where to access data
return
void
exception
UserException - thrown if error condition occurs, or invalid parameters passed.