public final class DsFormattingFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DS_CONFIGURATION
The default Dynamic Signature configuration data file inside the
library's JAR.
|
Constructor and Description |
---|
DsFormattingFactory() |
Modifier and Type | Method and Description |
---|---|
DsFormattingDevice |
createDsDevice(Token token)
Create a DS device for the given token using the default configuration
data.
|
DsFormattingDevice |
createDsDevice(Token token,
InputStream configuration)
Create a DS device for the given token using the provided configuration
data.
|
DsTransactionData |
createDsTransactionData()
Create an empty DsTransactionData.
|
public static final String DEFAULT_DS_CONFIGURATION
public DsFormattingDevice createDsDevice(Token token) throws IOException
The default Dynamic Signature configuration is from
DEFAULT_DS_CONFIGURATION
.
token
- the tokenIOException
- is thrown when parsing the configuration file.IdpRuntimeException
- when an exception is thrown by the json parserpublic DsFormattingDevice createDsDevice(Token token, InputStream configuration) throws IOException
Android Example: It assumes the DS configuration file is stored as an
Android project resource file at res/raw/dsConf.json
.
// context is an android.content.Context object InputStream is = context.getResources().openRawResource(R.raw.dsConf)); DsDevice device = DsFactory.createDsDevice(token, is);
token
- the tokenconfiguration
- the custom Dynamic Signature configuration data to
apply to this device.IOException
- is thrown when parsing the configuration file.IdpRuntimeException
- when an exception is thrown by the json
parserpublic DsTransactionData createDsTransactionData()