SSE4E GPError GPSystem ByteString ByteBuffer TLV TLVList Card Atr Key Crypto Application GPApplication GPSecDomain ASN1 CardFile IsoSecureChannel ApplFactory GPXML JsScript CardSim X509 CRL KeyStore CMSSignedData CMSGenerator XMLSignature OCSPQuery LDAP SOAP URLConnection PKCS11Provider PKCS11Session PKCS11Object OutlineNode OpenSCDP |
GPSecurityDomain - Reference Documentation
An instance of the GPSecurityDomain class represents an application that is a security domain on a smart card. Instances of this class are created using the getApplicationInstance() method of the application factory. Index of Methods
Properties
ConstructorPrototypeGPSecurityDomain(String profile) GPSecurityDomain(String profile, ByteString aid, Card card, Crypto crypto, Object dataMapper) DescriptionCreate a GPSecurityDomain object and initialize from profile. This constructor is provided for special development and testing purposes. The preferred method is to use the getApplicationInstance() method of the ApplicationFactory. Arguments
Exceptions
Examplevar sd = new GPSecurityDomain("profiles/ap_sample.xml"); assert(sd != null); deleteAID()PrototypeByteString deleteAID(ByteString aid) ByteString deleteAID(ByteString aid, Number[] sw) DescriptionDelete application, module or load file stored under given aid using the Global Platform DELETE_FILE APDU. Arguments
Return
Exceptions
Examplevar applAid = new ByteString("", HEX); sd.deleteAID(applAid, [0x9000, 0x6A88] ); installForInstallAndSelectable()PrototypeByteString installForInstallAndSelectable(ByteString loadFileAID, ByteString executableModuleAID, ByteString applicationAID, ByteString privileges, ByteString installParam, ByteString installToken) ByteString installForInstallAndSelectable(ByteString loadFileAID, ByteString executableModuleAID, ByteString applicationAID, ByteString privileges, ByteString installParam, ByteString installToken, Number[] sw) DescriptionCreate an instance of an application under the given AID using the executable module from the load file as the template. After instantiating the applet, it is selectable with the select command. The optional argument sw allows to define a list of acceptable status word returned by the ICC. If the argument is missing, then 9000 is the only acceptable status word. Arguments
Return
Exceptions
Examplevar loadFileAid = new ByteString("A000000001", HEX); var moduleAid = new ByteString("A00000000101", HEX); var applAid = new ByteString("A00000000102", HEX); var applPrivileges = new ByteString("00", HEX); var installParam = new ByteString("C900", HEX); sd.installForInstallAndSelectable(loadFileAid, moduleAid, applAid, applPrivileges, installParam, null); installForLoad()PrototypeByteString installForLoad(ByteString loadFileAID, ByteString securityDomainAID, ByteString loadFileDataBlockHash, ByteString loadParam, ByteString loadToken) DescriptionPrepare the download of a load file into the ICC with a subsequent load(), loadByName() or loadWithProfile() method. The optional argument sw allows to define a list of acceptable status word returned by the ICC. If the argument is missing, then 9000 is the only acceptable status word. Arguments
Return
Exceptions
Examplevar loadFileAid = new ByteString("A000000001", HEX); var sdAid = new ByteString("A000000003000000", HEX); sd.installForLoad(loadFileAid, sdAid, null, null, null); loadByName()PrototypeByteString loadByName(String capFileName) ByteString loadByName(ByteString capFileName) ByteString loadByName(ByteString capFileName, [[aid, dap]]) DescriptionRead cap file and transfer into GP card using the LOAD command APDU. Arguments
Return
Exceptions
Examplesd.loadByName("musclecard/CardEdge.cap"); select()PrototypeByteString select() ByteString select(Boolean next, Boolean noData) ByteString select(Boolean next, Number[] sw) ByteString select(Boolean next, Boolean noData, Number[] sw) DescriptionSelect security domain on ICC. Arguments
Return
Exceptions
Example/* var aid = new ByteString("D040000017010101", HEX); var card = new Card(_scsh3.reader); var crypto = new Crypto(); var application = new Application("profiles/ap_test.xml", aid, card, crypto, new Object()); var resp = application.select(); assert(resp instanceof ByteString); print(resp); var resp = application.select(false, false); assert(resp instanceof ByteString); print(resp); var resp = application.select(false, [ 0x9000 ]); assert(resp instanceof ByteString); print(resp); var resp = application.select(true, false, [ 0x6A86 ]); assert(resp instanceof ByteString); print(resp); */ sendApdu()PrototypeByteString sendApdu (Number cla, Number ins, Number p1, Number p2) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, Number[] sw) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, ByteString data) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, ByteString data, Number[] sw) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, Number le) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, Number le, Number[] sw) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, ByteString data, Number le) ByteString sendApdu (Number cla, Number ins, Number p1, Number p2, ByteString data, Number le, Number[] sw) DescriptionTransmit a Command-APDU to the ICC and receive the Response-APDU. The method updates the fields SW, SW1, SW2 and response of the associated card object with the values received from the ICC. An array of valid return codes can be passed as argument sw. If the SW1/SW2 from the ICC does not match with one of the entries in the array, then an GPError.CARD_COMM_ERROR exception is raised. The method supports ISO7816-4 extended format. This is automatically used, if the length of the data argument exceeds 255 or if the argument le exceeds 256. Arguments
Return
Exceptions
Example/* // Case 1: 0022F3A4 - MANAGE SE resp = application.sendApdu(0x00, 0x22, 0xF3, 0xA4); assert(resp instanceof ByteString); print(application.card.SW.toString(16) + " - " + resp); resp = card.sendApdu(0x00, 0x22, 0xF3, 0xA4, [0x9000]); assert(resp instanceof ByteString); // Case 2: 00B201F400 - READ RECORD from EF_STATUS resp = card.sendApdu(0x00, 0xB2, 0x01, 0x24, 0); assert(resp instanceof ByteString); print(card.SW.toString(16) + " - " + resp); assert(resp.length > 0); assert(application.card.SW == 0x9000); resp = card.sendApdu(0x00, 0xB2, 0x01, 0x24, 0, [0x9000]); assert(resp.length > 0); // Case 3: 002A90A008 - HASH resp = application.sendApdu(0x00, 0x2A, 0x90, 0xA0, new ByteString("9000800431323334", HEX)); assert(resp instanceof ByteString); print(application.card.SW.toString(16) + " - " + resp); assert(card.SW == 0x9000); resp = application.sendApdu(0x00, 0x2A, 0x90, 0xA0, new ByteString("9000800431323334", HEX),[0x9000]); // Case 4: 00A40204022F0000 - SELECT EF_STATUS resp = application.sendApdu(0x00, 0xA4, 0x02, 0x04, new ByteString("EF04", HEX), 0); assert(resp instanceof ByteString); print(application.card.SW.toString(16) + " - " + resp); assert(application.card.SW == 0x9000); assert(resp.length > 0); resp = application.sendApdu(0x00, 0xA4, 0x02, 0x04, new ByteString("EF04", HEX), 0, [0x9000]); assert(resp.length > 0); */ run()PrototypeVoid run(String scriptName) DescriptionLocate and execute script fragment in application profile. This method does the complete initialization of the key and data properties according to the declarations for this script fragment Key profiles are obtained from the ApplicationFactory that created the Application object. External data elements are mapped using the data mapper defined in the constructor or the getApplicationInstance() method of the application factory. Warning: This method is an extension to the methods defined in the Global Platform Scripting specification. It is provided as development and test aid. Arguments
Return
Exceptions
Example© Copyright 2003 - 2010 CardContact Software & System Consulting, Minden, Germany |