Setting the ATR and Serial Number

To generate a security module id object with ATR and serial number when the smart card is not physically available, perform the following:

Copy
// Static CUID value
String CUID = "20505000428830000001";
/**
* PlatformIds contain the card ATR, CUID.
* ATR and CUID are the constituents of security module id.
*/
Parameter[] platformIds = new Parameter[2];
platformIds[0] = new Parameter();
platformIds[0].setId(CCMConstants.
PLATFORM_ID_SMARTCARD_ATR); platformIds[0].setType(TYPE_STRING); platformIds[0].setEncoding(ENCODING_NONE); platformIds[0].
setValue("3b7b1800000031c06477e30300829000");
platformIds[1] = new Parameter();
platformIds[1]. setId("securitymodule.smartcard.gp20.CUID");
platformIds[1].setType(TYPE_STRING); platformIds[1].setEncoding(ENCODING_NONE); platformIds[1].setValue(CUID); SecurityModuleId smId = smMgr.
identifySecurityModule(CCMConstants. PLATFORM_CLASS_SMARTCARD, platformIds);