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 |
GPSystem - Reference DocumentationClass implementing the Global Platform GPSystem class Index of Methods
ConstructorPrototypeNone DescriptionThe GPSystem class only provides class functions. No objects can be instantiated.Exceptions
ExamplegetVersion()PrototypeString getVersion() DescriptionRetrieve the version of the Global Platform Scripting specification implemented by the runtime. Return
Exceptions
Exampleversion = GPSystem.getVersion(); assert(version == "1.1.0"); wait()Prototypewait(Number ms) DescriptionWait for a specified period Arguments
Return
Exceptions
Examplestart = new Date().valueOf(); waitingTime = 1000; GPSystem.wait(waitingTime); stop = new Date().valueOf(); elapsed = stop - start; // Allow a tolerance of 10 ms print("Wait: " + waitingTime + " ms / Elapsed: " + elapsed + " ms"); assert(((elapsed - 50) <= waitingTime) && ((elapsed + 50) >= waitingTime)); trace()Prototypeboolean trace(Object o) DescriptionAppend data to the trace file by calling the objects "toString()" method. Arguments
Return
Exceptions
Examplerval = GPSystem.trace("Testoutput from GPSystem.trace()"); // assert(rval == true); try { GPSystem.trace(null); } catch (e) { assert(e instanceof GPError); assert(e.error == GPError.INVALID_TYPE); } isTraceOn()Prototypeboolean isTraceOn() DescriptionReturn true if the trace is enabled. Return
Exceptions
Exampleassert(typeof(GPSystem.isTraceOn()) == "boolean"); markTrace()PrototypemarkTrace() DescriptionMark the current position in the trace output for later retrieval of trace output using the copyTrace() method. Return
Exceptions
ExampleGPSystem.markTrace(); copyTrace()PrototypeString copyTrace() DescriptionReturn the trace starting with the position marked with the markTrace() method up to the very last entry. Return
Exceptions
Examplevar msg ="Hello World"; GPSystem.trace(msg); var t = GPSystem.copyTrace(); if (t != null) { assert(t == msg + "\n"); } getVendorObject()PrototypegetVendorObject(String objectName) DescriptionRetrieve a vendor specific object Arguments
Return
Exceptions
Exampletry { obj = GPSystem.getVendorObject("myObject"); } catch (e) { assert(e instanceof GPError); assert(e.error == GPError.OBJECTCREATIONFAILED); } getSystemID()PrototypegetSystemID() DescriptionGet the ID of the system. For the smart card development platform a unique object identifier is returned. It has the following components: OpenSCDP.Runtime.MajorVersion.MinorVersion.Build.SerialNumber. Return
Exceptions
Examplevar id = GPSystem.getSystemID(); print(id); var s = id.toString(OID).split("."); print("Runtime : " + s[s.length - 5]); print("Major : " + s[s.length - 4]); print("Minor : " + s[s.length - 3]); print("Build : " + s[s.length - 2]); print("Serial : " + s[s.length - 1]); dateTimeByteString()PrototypedateTimeByteString() DescriptionReturn a ByteString containing the current date and time Return
Exceptions
Exampletime = GPSystem.dateTimeByteString(); assert(time != null); assert(time instanceof ByteString); mapFilename()PrototypemapFilename(String filename, Number location) mapFilename(String filename) DescriptionSearches for a file at the given location and maps the filename to the system specific absolute path. If no location is specified the function uses the default location identifier GPSystem.AUTO.Arguments
Return
Exceptions
ExampleabsFilename = GPSystem.mapFilename("config.js", GPSystem.SYS); assert(absFilename != null); absFilename = GPSystem.mapFilename("config.js"); assert(absFilename != null); absFilename = GPSystem.mapFilename("novalidfile.js"); assert(absFilename == null); © Copyright 2003 - 2010 CardContact Software & System Consulting, Minden, Germany |