Layering Model

SETREF has the following modular architecture, which is organized into a number of layers:
         _____________________________________________________
         |                                                   |
         |                 [application/user]                |
         |___________________________________________________|
         |                                                   |
         |                      set_msg                      |
         |___________________________________________________|
         |                                                   |
         |                        ops                        |
         |___________________________________________________|
         |             |             |                       |
         |  cache_ctx  |   log_ctx   |         pkcs7         |
         |_____________|_____________|_______________________|
         |                  |                  |   |         |
         |       store      |       asn1       |   |  TIPEM  |
         |__________________|__________________|   |_________|
         |                  |                  |   |         |
         |       util       |       a2c        |   |  BSAFE  |
         |__________________|__________________|   |_________|
         |                  |                  |  
         |    alloc_ctx     |      io_ctx      |  
         |__________________|__________________|  
         |                                     |
         |              error_ctx              |
         |_____________________________________| 

Higher layers rely on the services provided by lower layers, while lower layers are oblivious to the higher layers. Unfortunately, there is one exception to this rule: encrypting data under OAEP padding requires a layering violation because OAEP processing, which is a cryptographic procedure (and thus at a lower layer), is specified in SET such that it requires knowledge of SET-specific data types. However, SET-specific data types are defined in higher layers.

From bottom to top, a short description of each module is provided below.

error_ctx

SETREF uses specially-formatted error return codes which provide a per-module error numbering scheme. In certain cases, an error_ctx passed in as a parameter permits error information, beyond the numeric return value, to be obtained by the application programmer. The error_ctx module also provides functions useful to the programmer for logging errors and for obtaining textual descriptions of return values.

io_ctx

Most I/O in SETREF is performed using the io_ctx I/O abstraction. The interface for this module uses a subset of the interface defined by the stdio I/O package. Two io_ctx implementations are provided with SETREF: io_ctx_stdio, which is implemented using the stdio package, and io_ctx_memio, which keeps data in-core.

alloc_ctx

An alloc_ctx is a memory allocation abstraction based on the standard malloc allocator package. SETREF uses application-programmer-supplied heaps to allocate any memory that is "passed back" to the application programmer.

a2c

SET messages are described using ASN.1 and encoded using DER. a2c provides an ASN.1/DER processing runtime which is used by most of SETREF. This runtime may at times be used by the application programmer, for instance for decoding X.509 Distinguished Names.

util

The util module provides generic utility functions to SETREF and to the application programmer. Many applications will already have some or all of these functions.

asn1

The asn1 module supplies the SET data definitions (x509.h, pkcs7.h, and asn1set.h) used by SETREF, and the DER encoding information used by the ASN.1/DER runtime. This information is generated through automatic means from the ASN.1 supplied in the SET specification.

The application programmer uses the data definitions as the fundamental SET datatypes. The DER encoding information (which is contained in x509.c, pkcs7.c, and asn1set.c) should be ignored by the application programmer as it is only meaningful to the ASN.1/DER runtime.

pkcs7

The pkcs7 module provides an implementation of the PKCS-7 datatype DigestedData. The application programmer will never access this module directly.

log_ctx

The log abstraction is used to retain per-message information, for the most part, the RRPID and/or XID of messages that have been processed. This information is used primarily to detect repeated/replayed messages.

SETREF expects there to be a single, global log file which the user manages. Although SETREF provides an example log_ctx which uses a simple file-based database, it is expected that application programmers will supply implementations for log_ctx that support local implementation requirements rather than using the example implementation provided with SETREF.

cache_ctx

A cache abstraction is used to carry transaction-specific data between messages and to hold persistent state for the life of a transaction. The application programmer will be expected at times to put information into a cache. Documentation for each type of SET message enumerates what information, if any, the application programmer is expected to put into the transaction-specific cache. Although SETREF provides an example cache_ctx which uses a simple file-based database, it is expected that application programmers will supply cache_ctx implementations that support local implementation requirements rather than using the example implementation provided with SETREF.

ops

The SET protocol defines a number of primitive cryptographic operators, for instance S() for the signature operation and E() for the public-key encryption operation. Nearly all cryptographic functionality in SET is accessed using these primitive operators. The application programmer will never access this module directly.

set_msg

set_msg is the module that the application programmer will most commonly use. This module organizes and performs all SET-specific protocol processing and provides the interface for sending and receiving SET messages.

BSAFE

BSAFE, which is not part of SETREF, implements the fundamental cryptographic algorithms employed by SET, for instance DES, RSA, and SHA-1. The application programmer will never access this module directly.

TIPEM

TIPEM, which is not part of SETREF, provides an implementation of the PKCS-7 datatypes EnvelopedData and SignedData. TIPEM also implements generic X.509 certificate processing. The application programmer will never access this module directly.


Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.