Wib Plug-Ins Interface Spec
Wib Plug-Ins Interface Spec
Wib Plug-Ins Interface Spec
© 2011, 2013 Giesecke & Devrient 3S AB. Proprietary/Confidential. All rights reserved.
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Contents
1 Document profile __________________________________________________ 6
1.1 Purpose of the document ..................................................................... 6
1.2 Target audience .................................................................................... 6
1.3 Terms, acronyms and abbreviations .................................................... 6
1.4 Symbols ................................................................................................. 6
1.5 References ............................................................................................. 7
2 Introduction _______________________________________________________ 9
2.1 What is a Wib™ plug in? ...................................................................... 9
2.2 Organization of this document.......................................................... 10
-2-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
-3-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
-4-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
-5-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
1 Document profile
1.1 Purpose of the document
This document specifies the interfaces and functionality of
the standard SmartTrust Wib™ plug-ins. The documentation
supports Wib application development with examples given
in WIG WML, [WIGWML]. The content of this
documentation requires knowledge about the G&D
SmartTrust Delivery Platform and Wib.
1.4 Symbols
Symbol Description
K1, K2, K, K’ DES keys.
X || Y Concatenation of byte-strings X and Y (in that order).
-6-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
1.5 References
Ref. Title
[WIGWML] Specification - WIG WML v.5, G&D SmartTrust
[WMLCLIB] WAP WMLScript Crypto library,Version 05-Nov-1999, with
specification changes as of 27-Dec-2000. Wireless Application
Forum
[GSM03.38] ETSI. GSM 03.38. Alphabets and language specific information.
Version 7.2.0. Release 1998.
[GSM11.14] ETSI. GSM 11.14. Specification of the SIM Application Toolkit
for the Subscriber Identity Module - Mobile Equipment (SIM -
ME) interface. Version 8.7.0. Release 1999.
[PKCS1] “PKCS #1 v2.0: RSA Cryptography Standard”, RSA
Laboratories
[PKCS5] RSA Laboratories , “PKCS #5 v2.0: Password-Based
Cryptography Standard”, http://www.rsalabs.com/pkcs/
[PKCS7] “PKCS #7 v1.5: Cryptographic Message Syntax”, RSA
Laboratories
[CMS] “Cryptographic Message Syntax”, RFC 2630, R. Housley
[WTLS] Wireless Application Forum , “Wireless Transport Layer
Security”, http://www.wapforum.org/
[DEA] ISO 8731-1, “Banking – Approved algorithms for message
authentication – Part 1: DEA”
[ISO9797] ISO/IEC 9797-1:1999(E) – Information technology – Security
techniques – Message Authentication Codes (MACs)
[SHA1] FIPS PUB 180-1, “Secure Hash Standard (SHS)”
-7-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Ref. Title
[MODES] ISO/IEC 10116 – Security Techniques – Modes of Operation for
an n-bit Block Cipher Algorithm”
-8-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
2 Introduction
The plug-ins included in this specification are specified by
G&D SmartTrust. The plug-ins are implemented by SIM
vendors on a Wib card. The Card Issuer, which is normally
a Mobile Operator, might define only a subset of the plug-
ins for inclusion on a specific SIM card.
The Wib architecture allows for other entities than G&D
SmartTrust to specify and implement plug-ins on SIM cards.
Therefore it is necessary to find out the current availability
of plug-ins on a specific target SIM before building
applications.
The WIG WML used in the examples is supported by G&D
SmartTrust Delivery Platform version 6.1 and later.
1
For backward compatibility, earlier versions of the plug-in calling syntax is supported, but the use of the
syntax specified in this document is encouraged.
2
For further details, refer to [WIGWML].
-9-
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
plug-in.
name String The name of the No
mandatory plug-in to call.
params String The input Yes
mandatory parameters to the
plug-in.
- 10 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
3.1.2 Description
The P7 plug-in is used to provide a digital signature based
on a private RSA key stored on a SIM card. The output of
this plug-in is compliant with the WMLScript Crypto
Library SignText function, [WMLCLIB]. As such, P7 will
also be compliant with other important (de-facto) standards
such as [PKCS1], [PKCS7], [CMS].
The plug-in first shows the text to be signed to the user and
then prompts for a signature PIN. The plug-in implements
true WYSIWYS (What-You-See-Is-What-You-Sign).
- 11 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Note that if the total length of the output from the P7 plug-in
exceeds the maximum length of a variable, 255 for Wib 1.3
and earlier or 8191 for Wib 2.0, this will lead to an error
situation.
- 12 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
3.2.2 Description
The FP plug-in is used to provide a digital signature based
on a private RSA key stored on a SIM card. The output of
this plug-in is a WrappedContent structure described below
that includes a PKCS#1 compliant signature. As such, FP
will also be compliant with other important (de-facto)
standards such as [PKCS1], [PKCS7], [CMS].
FP may seem strikingly similar to the P7 plug-in. However,
it is operates in a different way. As opposed to the P7 plug-
in, FP will not operate strictly according to the WYSIWYS
(What-You-See-Is-What-You-Sign) paradigm, but instead
work more as an alternative to a smart card in a “fixed” PKI
scenario. This ensures that FP can be utilized in cases where
P7 is clearly unsuitable such as the following.
- 13 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 14 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Item Description
Implicit The signer is implied by the content.
sha_key_hash The SHA-1 hash of the public key, encoded as specified in
[WTLS].
certificate_url A URL where the certificate is located.
key_usage_id An ID revealing the key usage flag (in the PKCS#15 sense)
of the signature key.
- 15 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
struct {
SignerInfoType signer_info_type;
switch (signer_info_type) {
case implicit: struct{};
case sha_key_hash: opaque hash[20];
case certificate_url: opaque url<0..255>;
case iccid: opaque iccid[10];
case key_usage_id: uint8;
};
} SignerInfo;
struct {
uint8 version;
Signature signature;
SignerInfo signer_infos<0..2^16-1>;
} WrappedContent;
Item Description
Version Version of the WrappedContent structure. For this
specification the version is 1.
Signature Signature
signer_infos Information on the signer. This may contain zero items (in
case the signer is implicit). Also, there may be multiple
items of SignerInfo present (public key hash and a
certificate).
- 16 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
3.3.2 Description
This plug-in is used for application-level asymmetric
decryption. The decryption is performed according to
RSADP. See [PKCS1] for further reference.
Just as in the case with the FP plug-in, the motivation for
this plug-in is to serve as a replacement for a smart card in a
“fixed” PKI scenario. While the FP plug-in is focused on
digital signatures, AD is focused on the remaining private
key operation, namely decryption.
Together, FP and AD form a complete replacement to the
“PC attached” smart card, and in addition offer other
benefits like end-user mobility, cost effectiveness and easy
deployment.
If the output of the plug-in shall be used in a network
application it is crucial that the plaintext is protected by
some means, e.g. using "blinding".
- 17 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 18 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
3.4.2 Description
This plug-in is used for on-board generation of PKCS#1 compliant
digital signature keys for P7, FP and AD plug-ins. See [PKCS1] for
further reference.
The returned public key is formatted according to the ASN.1
structure RSAPublicKey.
Wib 1.3, and earlier versions, can only handle 255 bytes return
values from plug-ins due to limitations in variable size. Due to this,
the maximum key size of the *OBKG plug-in is 1536 bits which is
192 bytes for Wib 1.3. Wib 2.0 does not have this limitation.
- 19 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 20 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 21 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
<!-- send the created public key to the server side -->
<go href=" http://wibtraining.com/obkg/test.php?RESULT=$(OUTPUT)"/>
</p>
</card>
</wml>
<!-- call the *OBKG plug-in to retrieve the created public key-->
<plugin name="*OBKG" params="\x03\x09\x02" destvar="OUTPUT2"/>
- 22 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
4.1.2 Description
The 3DES encrypt plug-in is used to encrypt arbitrary
application-level data. It is typically called from a WIG
WML document to privacy-protect data before it is
transmitted to a network application.
- 23 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 24 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 25 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
4.2.2 Description
The 3DES decrypt plug-in is used to decrypt arbitrary
application-level data. It is typically called from a Wib
script to recover the data that has been privacy protected by
a network application.
- 26 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 27 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
4.3.2 Description
The 3DES sign plug-in is used to calculate a message
authentication code (MAC) for arbitrary application-level
data. The MAC can be used as a data integrity mechanism to
verify that data has not been altered in an unauthorized
manner. It can also be used as a message authentication
mechanism to provide assurance that a message has been
originated by an entity in possession of the secret key.
The plug-in displays the text to be signed to the user and
prompts for a PIN before calculating the MAC.
The cryptographic algorithm used is ISO9797 MAC
algorithm 3, padding method 2. There is an option of using
first 4 bytes (32 bits) or 8 bytes (64 bits) of the MAC
calculation as output of this plug-in.
- 28 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 29 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
4.4.2 Description
The 3DES Unwrap key plug-in is a key-management plug-in
that enables a party in possession of a certain secret key,
called a key encryption key, to replace a key in the SIM
based key file, EFSKEY, at its own desire, under a set of well-
defined security conditions.
- 30 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 31 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6 Encrypt the key data EKD = TDEA_ENCR(KD) using the following cipher
parameterization:
K1, K2 Key Encryption Keys.
Cipher mode Outer CBC. See “A.1 Triple encryption (TDEA_ENCR)” on page
68 for details.
IV 0 (this is not a weakness since the nonce effectively becomes a
randomly chosen IV).
7 EKD is the Encrypted Key Data to be sent to the plug-in.
- 32 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 33 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
5.1.2 Description
This plug-in is used for on-board generation of PKCS#1 compliant
digital signature keys for P7, FP and AD plug-ins. See [PKCS1]
further reference.
The returned public key is formatted according to the ASN.1
structure RSAPublicKey.
Wib 1.3, and earlier versions, can only handle 255 bytes return
values from plug-ins due to limitations in variable size. Due to this,
the maximum key size of the *OBKG plug-in is 1536 bits which is
192 bytes for Wib 1.3. Wib 2.0 does not have this limitation.
- 34 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 35 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 36 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
<!-- send the created public key to the server side -->
<go href=" http://wibtraining.com/obkg/test.php?RESULT=$(OUTPUT)"/>
</p>
</card>
</wml>
<!-- call the *OBKG plug-in to retrieve the created public key-->
<plugin name="*OBKG" params="\x03\x09\x02" destvar="OUTPUT2"/>
2nd Generation 3DES security plug ins” on page 19. The 1st generation plug-ins are
the following.
• ENCR - 3DES Encryption
- 37 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
5.2.2 Description
The 3DES encrypt plug-in is used to encrypt arbitrary
application-level data. It is typically called from a WIG
WML document to privacy-protect data before it is
transmitted to a network application. The cryptographic
algorithm used is triple DES as described in [DEA], see also
“Appendix A: Triple DES modes” on page 68.
Before encryption, the plug-in pads the data with 0-7 zero
bytes to make the length divisible by 8.
- 38 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 39 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
5.3.2 Description
The 3DES decrypt plug-in is used to decrypt arbitrary
application-level data. It is typically called from in a wiblet
to recover the data that has been privacy protected by a
network application. The cryptographic algorithm used is
triple DES as described in [DEA], see also “Appendix A:
Triple DES modes” on page 68.
- 40 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
<card>
<p>
<!-- Set the encrypted data -->
<setvar name="CipherText"
value="\x04\x2b\x85\x36\x05\x25\x67\x48\xe5" class="Binary"/>
<!-- call the decryption plug-in -->
<plugin name="DECR" params="\x01$(CipherText)"
destvar="PlainText" />
<!-- Display the plaintext to the user -->
Your new PIN code is: $(PlainText)
</p>
</card>
</wml>
5.4.2 Description
The 3DES sign plug-in is used to calculate a message
authentication code (MAC) for arbitrary application-level
data. The MAC can be used as a data integrity mechanism to
verify that data has not been altered in an unauthorized
manner. It can also be used as a message authentication
mechanism to provide assurance that a message has been
originated by an entity in possession of the secret key.
The plug-in displays the text to be signed to the user and
prompts for a PIN before calculating the MAC.
The cryptographic algorithm used is triple DES with two
keys (EDE2) in outer CBC mode. The first 4 bytes (32 bits)
of the MAC calculation are used as output of this plug-in.
- 41 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 42 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6.1.2 Description
The terminal profile indicates the SIM Toolkit capabilities
of the ME. It is downloaded to the SIM as part of the SIM
initialization procedure if the terminal supports SIM Toolkit.
The terminal profile could be very useful for the application
to, for example customize the user dialog. The Retrieve
Terminal Profile plug-in enables the application to retrieve
this information from the SIM.
- 43 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6.2.2 Description
The Retrieve Remote File Management Status plug-in is
used for retrieving content of a special dedicated file on the
SIM. The information can be used to report to the user, the
outcome of the GSM 03.48 Remote File Operation.
The plug-in gets three bytes as an input value and according
to those seeks the file EF 6F09 in the directory DF 2900 and
reads the required information and returns it in the output
variable.
- 44 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Offset high:'0x00'
Offset low: '0x00'
Length: '0x02'
Retrieve status description:
Offset high:'0x00'
Offset low: '0x02'
Length: '0x29'
When using the input values defined for retrieving the status
code or status description the output will be 1 byte or 40
bytes respectively. The maximum size of the status
description, i.e. the space that is reserved for it in EF (6F09),
is 40 bytes.
- 45 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6.3.2 Description
The Change PIN plug-in is used for requesting change of a
PIN. The new PIN value is specified by the user through the
ME keypad. The user is requested to enter the new PIN
twice.
- 46 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6.4.2 Description
This plug-in offers a means for a trusted party to reset a PIN
in the SIM over-the-air and set a new value.
- 47 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 48 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 49 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
</p>
</card>
</wml>
In above shown example, the ID Type is ‘Asymmetric key
usage’, Private object ID is ‘sign’ key and Encrypted PIN
Block header is set to value 1.
6.5.2 Description
The Event Manager plug-in allows an application to
enable/(refresh)/disable the event mechanisms supported in
Wib 1.2 (and later), both handset events and internal SIM
events.
When the plug-in is called with the DISABLE flag, Wib is
set to ignore all incoming events, both internal and handset
events. This is valid either until the plug-in is called again
with the ENABLE flag, or until next SIM Initialization,
whichever occurs first.
When the plug-in is called with the ENABLE/REFRESH
flag, the plug-in examines the EF (EventConfig), 6F0B. For
all internal events, a coupling from those events to the
corresponding event-activated scripts in EF (6F03) is
established. If handset events occur in the file, and the
handset supports events, the STK command SET UP
EVENT LIST is issued (if needed).
- 50 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
6.6.2 Description
The *ICCID plug-in provides functionality for the retrieval
of the ICCID of the card where Wib is executing.
- 51 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
7.1.2 Description
The Display User Data plug-in is called from WIG WML to
let the user display and/or update the value of user specific
data.
When the plug-in is called, the requested data on the SIM is
displayed to the user together with a descriptive text. The
user will then have the opportunity to update the value
through the normal editing functions in the terminal.
The displaying of the user data is protected with a PIN1 that
needs to be entered before the data is shown. The PIN1 will
be blocked in case it has been entered incorrectly too many
times. If the PIN1 is disabled Wib execution is aborted.
User data is contained within user data objects stored in a
file on the SIM. An object contains a tag, length, data
coding scheme, value and descriptive text. The object and
its usage is defined by the mobile operator and the user may
only change the value part through the DUDA plug-in.
The data managed by the DUDA plug-in may be retrieved
by an application by means of the EUDA plug-in.
- 52 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
7.2.2 Description
The Encrypted User Data plug-in is called to fetch
Encrypted User Data from the SIM.
The plug-in fetches user data objects from the user data
object file. To secure the data for transportation, the list of
objects is padded and encrypted before it is stored in the
output variable. The outcome of the plug-in is always an
encrypted user data object value string. The maximum
length for the output of the plug-in is 255 bytes. The input
parameters include a key id to be used for fetching an
encryption key.
User data objects are objects stored in a file on the SIM. An
object contains a tag, length, data coding scheme, value and
descriptive text. The object and its usage is defined by the
mobile operator and its data may be retrieved with the
EUDA plug-in.
- 53 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 54 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 55 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
7.3.2 Description
The *PAD plug-in is a powerful data management plug-in
for privileged applications. It was originally intended to be
used by applications defined by G&D SmartTrust. However,
provisions have been made for using it even in applications
defined by others and approved by the operator.
The *PAD implements a tag-value storage that can be seen
as an on-card database. Since memory is limited, it is
important that an application using *PAD clearly states it
maximum memory need to ensure that applications do not
fail due to lack of storage space. Since *PAD stores data
items that are identified by a tag, it is also important to
ensure that applications use separate tag-ranges.
- 56 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
3
For *PAD implementations on Wib 2.0 cards and later, tag-
dependent storage areas are made mandatory.
- 57 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
4
For *PAD implementations on Wib 2.0 cards and later, tag-
dependent storage areas are made mandatory.
- 58 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 59 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Create operation
The purpose of the create operation is to reserve a defined
amount of memory for the data object to ensure the
available storage space and to minimise the need of de-
fragmentation procedures.
The create operation is able to create a data storage object to
the PAD default storage area. It is possible to create one
data storage object with one Plug-In Wib command. The
data storage object is named with a tag value in the range
'01'h…'FE'h.
The create operation is not be allowed for tags that have
been assigned a tag-dependent storage area.
Input for create operation includes the Tag of data object
and the length of storage space. The result of create
procedure is returned to the defined output variable.
New data storage object is created if a tag-dependent storage
area has not been configured for the tag and the requested
tag does not already exist in the PAD default storage area
and if there is enough space available in the PAD default
storage area. The length of storage space is reserved
according to the given input value. Output value "create
executed successfully" is stored in the output variable.
Data storage object is not created if a tag-dependent storage
area has been configured for the tag or if the tag already
exists in the PAD default storage area or if there is not
enough space available for the new data storage object
- 60 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Value Description
'00'h Create executed successfully
'01'h Not enough memory available in the PAD default storage
area
'02'h Data storage object tag is already reserved in the PAD
default storage area
'03'h Operation not allowed
'04'h…'FF'h Reserved for Future Use
Table 7 - Output from Create Operation
5
Lenght on two bytes is supported by *PAD implementations on Wib 2.0 cards and later.
- 61 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Update operation
Update operation is used to update a data object. It is
possible to update one data object with one Plug-In Wib
command. The data object is identified with the tag in the
plug-in input.
If no tag-dependent storage area has been configured for the
tag in the plug-in input and the corresponding data storage
object does not exist in the PAD default storage area, a new
data storage object will be created in the PAD default
storage area according to the given input parameters.
The input for update operation includes a data object tag and
a data object to be stored.
The result of update operation is returned to the defined
output variable.
PAD default storage area
The update operation for cases where no tag-dependent
storage area has been configured for the tag in the plug-in
input is defined in this section.
If the requested data storage object exists in the PAD default
storage area and the new data object value fits to the storage
space, data storage object is updated with the given data
object. Output value "Update executed successfully" is
stored in the defined output variable.
If the requested data storage object exists in the PAD default
storage area, but the length of storage space is too short for
the new data object value, the old data storage object is
deleted. A new data storage object is created according to
the given input values (tag, length of data object and data
object) if there is enough space available in the PAD default
storage area. The length of new storage space is set to be
equal with the length of data object in the plug-in call.
After creation the data object in the plug-in input is stored in
the new data storage object and output value "Update
executed successfully" is returned to the output variable.
If there is not enough space available for the new data
storage object, result value "No memory space available" is
returned to the output variable.
If the requested data storage object does not already exist in
the PAD default storage area, but there is enough space
available, a new data storage object is created and updated
with the given data object as described above. Output value
"Update executed successfully" is stored in the defined
output variable.
- 62 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
- 63 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
Read operation
The read operation is used to read a data object. It is
possible to read one data object with one Plug-In Wib
command. The data object is identified with the tag value.
The input for read operation includes the tag of requested
data object. The data object is returned to the output
variable.
If a tag-dependent storage area has been configured for the
tag in the plug-in input, the entire contents of the tag-
dependent storage area is stored in the output variable. Note
that an Update operation may update only the beginning of a
tag-dependent storage area, while the size of the data
returned by a Read operation using a tag for which a tag-
dependent storage area has been configured will always be
the same as the size of the storage area.
An empty value is stored in the output variable if the
requested data object doesn't exist in the PAD default
storage area and no tag-dependent storage area has been
configured for the tag.
If the requested data object exists in the PAD default storage
area and the data object is not corrupted (LD ≤ LS), the data
object is stored in the defined output variable.
If the data object is corrupted (LD > LS), it is updated with
an empty value (LD = 0) and an empty output value (length
is zero) is returned to the output variable.
If a tag-dependent storage area has been configured for the
- 64 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
tag in the plug-in input but the configuration data does not
identify a valid storage area according to the implemented
tag-dependent storage area configuration method an empty
value shall be stored in the output variable.
Input to Read Operation
Delete operation
The purpose of the delete operation is to delete the data
object and free the storage space which is reserved for the
data object. Alternatively the whole PAD default storage
area can be emptied with one delete operation.
Delete operation deletes one data storage object or all data
storage objects in the PAD default storage area. Output of
delete operation is stored in the output variable defined in
the Plug-In Wib command.
The delete operation shall not be allowed for tags that have
been assigned a tag-dependent storage area.
- 65 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
The input for delete operation includes only the tag of data
storage object to be deleted. Tag value in the range
'01'h…'FE'h defines the data storage object to be deleted.
Tag value 'FF'h means that all data storage objects in the
PAD default storage area are deleted.
Result value of the delete operation is returned to the output
variable.
When calling delete operation the plug-in will first check if
a tag-dependent storage area has been configured for the tag.
If so, the operation is not allowed and “Operation not
allowed” is returned in the output variable. If not, the plug-
in shall check if the tag value is 'FF'h in the input. If yes, all
data storage objects in the PAD default storage area are
deleted and the output value "Delete executed successfully"
is returned to the output variable.
If the tag value is in the range '01'h…'FE'h and no tag-
dependent storage area has been configured for the tag, the
plug-in will check if the requested data storage object exist
in the PAD default storage area. If it exists, the requested
data storage object is deleted and the output value "Delete
executed successfully" is returned to the output variable. If
the requested data storage object doesn't exist in the PAD
default storage area and no tag-dependent storage area has
been configured for the tag, output value "Delete executed
successfully" is returned to the output variable.
Input to Delete Operation
When calling delete operation the Input of the Plug-In Wib
command is coded according to the following.
- 66 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
The following deletes the tags 'E0'h and 'E1'h from PAD.
<?xml version="1.0" encoding="UTF-8"?>
<wml xmlns="http://www.smarttrust.com/WIG-WML/5.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.smarttrust.com/WIG-WML/5.0
http://www.smarttrust.com/xsd/wigwml-5.0.xsd">
<card>
<p>
Delete E0 and E1
<!-- Delete storage -->
<plugin name="*PAD" params="D\xE0" destvar="Value1"/>
<plugin name="*PAD" params="D\xE1" destvar="Value2"/>
Results: $(Value1) - $(Value2)
</p>
</card>
</wml>
- 67 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
P1 P2 P3 P4
IV
C1 C2 C3 C4
- 68 -
Developer’s Corner – References and Specifications
SmartTrust WibTM Plug-ins
C1 C2 C3 C4
IV
P1 P2 P3 P4
- 69 -