java.lang.Object | |
↳ | com.samsung.android.knox.mpos.MPOSPolicy |
This class provides functionality settings.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
API to get device certificate.
| |||||||||||
API to get the MPOSPolicy instance.
| |||||||||||
API to check whether the Knox POS SDK is supported or not.
| |||||||||||
API to show TUI View based on layout.
| |||||||||||
API to show TUI View based on layout with dynamic String.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
API to get device certificate.
It can be used to encrypt important data like AES encrypt key.
This API should be called every time when encrypt key is needed.
MPOSPolicy
mpospolicy = getInstance(Context)
;
byte[] certChain = mMPOSPolicy.getCertificateChain();
int index = 0;
//root_certificate_buffer_length
byte[] root_certificate_buffer_length_bytes = Arrays.copyOfRange(certChain, index, index + CERT_LENGTH_BYTE);
index = index + CERT_LENGTH_BYTE;
int root_certificate_buffer_length = convertByteArrayToInt(root_certificate_buffer_length_bytes);
ByteBuffer data1 = ByteBuffer.allocate(CERT_LENGTH_BYTE);
data1.order(ByteOrder.LITTLE_ENDIAN);
data1.putInt(root_certificate_buffer_length);
root_certificate_buffer_length_bytes = data1.array();
root_certificate_buffer_length = convertByteArrayToInt(root_certificate_buffer_length_bytes);
//root_certificate
byte[] root_certificate = Arrays.copyOfRange(certChain, index, index + root_certificate_buffer_length);
//Device root certificate used to derive client certificate
X509Certificate rootCert = byteToX509Certificate(root_certificate);
index = index + root_certificate_buffer_length;
//leaf_certificate_buffer_length
byte[] leaf_certificate_buffer_length_bytes = Arrays.copyOfRange(certChain, index, index + CERT_LENGTH_BYTE);
index = index + CERT_LENGTH_BYTE;
int leaf_cert_length = convertByteArrayToInt(leaf_certificate_buffer_length_bytes);
ByteBuffer data2 = ByteBuffer.allocate(4);
data2.order(ByteOrder.LITTLE_ENDIAN);
data2.putInt(leaf_cert_length);
leaf_certificate_buffer_length_bytes = data2.array();
leaf_cert_length = convertByteArrayToInt(leaf_certificate_buffer_length_bytes);
//leaf_certificate
byte[] leaf_certificate = Arrays.copyOfRange(certChain, index, index + leaf_cert_length);
//You should use leaf_cert (X509Certificate driven from Samsung device root key) to encrypt your symmetric key.
X509Certificate leafCert = byteToX509Certificate(leaf_certifcate);
API to get the MPOSPolicy instance.
context | context of caller app. |
---|
API to check whether the Knox POS SDK is supported or not.
true
if supported, false
if not supported.
API to show TUI View based on layout.
activity | activity of caller app. |
---|---|
xmlName | name of tui layout. |
info | payment info instance. |
encryptKey | encryptKey to encrypt entered pin. can be null when MPOSPayInfo algorithm is MPOS_SHA_384 . |
cb | callback instance to receive TUI result. |
API to show TUI View based on layout with dynamic String.
activity | activity of caller app. |
---|---|
xmlName | name of tui layout. |
info | payment info instance. |
encryptKey | encryptKey to encrypt entered pin. can be null when MPOSPayInfo algorithm is MPOS_SHA_384 . |
dynamicValues | Map to allow run time string on TUI View. |
cb | callback instance to receive TUI result. |