PInitReq
using the following ASN.1:
PInitReq ::= SEQUENCE { -- Purchase Initialization Request rrpid RRPID, language Language, localID-C LocalID, localID-M [0] LocalID OPTIONAL, chall-C Challenge, brandID BrandID, bin BIN, thumbs [1] EXPLICIT Thumbs OPTIONAL, piRqExtensions [2] MsgExtensions {{PIRqExtensionsIOS}} OPTIONAL }In SETREF, the corresponding data type is named
asn1set__PInitReq
, and is defined as a native C type as follows:
typedef struct asn1set__PInitReq_ { # define asn1set__PInitReq__localID_M 0 # define asn1set__PInitReq__thumbs 1 # define asn1set__PInitReq__piRqExtensions 2 UCHAR _present[1] ; asn1set__RRPID rrpid ; asn1set__Language language ; asn1set__LocalID localID_C ; asn1set__LocalID localID_M ; asn1set__Challenge chall_C ; asn1set__BrandID brandID ; asn1set__BIN bin ; asn1set__Thumbs thumbs ; asn1set__MsgExtensions *piRqExtensions ; } asn1set__PInitReq ;
asn1set
specifies the namespace for this type,
which is used to disambiguate the type name among the different ASN.1 modules.
ASN.1 provides namespaces for defining types, but since C has no notion of
namespaces, the namespace for each type is pre-pended to the name of
that type.
In SETREF, there are three namespaces for defined types:
asn1set
for SET-specific types
pkcs7
for the types defined by the PKCS-7 messaging syntax
and related standards
x509
for the certificate and certificate revocation list
syntax
_present
element is used for specifying the presence
or absence of optional elements. In this example, localID-M
and
thumbs
are both optional in the ASN.1.
The following macros are used to
are used to specify or query the status of
optional elements:
SET_PRESENT()
IS_PRESENT()
SET_ABSENT()
IS_ABSENT()
IS_PRESENT(msg,asn1set__PInitReq__localID_M)
determines whether localID-M
is present
in msg
, where msg
is an object of type PInitReq
.
It is usually unnecessary to invoke the SET_ABSENT()
macro
because absent is the default setting.
Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.