java.lang.Object | |
↳ | com.sec.biometric.iris.SecIrisManager |
This class is deprecated.
Deprecated since v1.1. No replacement
This class provides APIs for third party ISV apps to capture the iris using the IR camera on an integrated Samsung device. It also returns an encrypted PID block containing the iris data.
Note: This feature is only supported on Samsung devices with integrated IR camera.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This API returns the encrypted hmac.
| |||||||||||
This API returns encrypted PID xml/protobuf having biometric data.
| |||||||||||
This API returns the encrypted session key.
| |||||||||||
gets the instance of iris manager.
| |||||||||||
API to register for a callback to receive the iris capture events.
| |||||||||||
API to start the iris capture.
| |||||||||||
API to stop or cancel the iris capture.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This API returns the encrypted hmac.
LicenseRequiredException | If caller does not have the required permissions. |
---|---|
DeviceTamperedException | If device is rooted. |
NeedsCaptureException | In case the API is called without doing a prior successful capture. |
A third party ISV app can use this API to get the encrypted hmac returned as byte array. The byte array should be base64 encoded to use in authenticate request.
SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { byte[] encryptedhmac = mSecIris.getEncryptedHMAC(); String encryptedencodedhmac = Base64.encodeToString(encryptedhmac, Base64.DEFAULT); String hmactag = "<Hmac>" + encryptedencodedhmac + "</Hmac>"; } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |
This API returns encrypted PID xml/protobuf having biometric data.
inputpiddata | PID formed by the application into which the biometric data has to be inserted. |
---|---|
inputpidtype | type of the PID passed as input.It can be xml or protobuf. Please refer
|
certChain | certificate to be used for encryption( along with the intermediate certificate if it is not signed by a well-known root CA) |
LicenseRequiredException | If caller does not have the required permissions. |
---|---|
DeviceTamperedException | If device is rooted. |
EncryptionException | If there is a problem in doing the Encryption. |
EngineException | If there is an exception from the iris detection engine. |
InvalidParamException | If parameter like biotype is not in sync with parameter of startCapture API. |
NeedsCaptureException | In case the API is called without doing a prior successful capture. |
NonTrustedCertificateException | if the mCertChain is not a valid UIDAI CA certificate. |
PIDParserException | If not able to parse the inputpiddata. |
A third party ISV app can use this API to get the encrypted PID having biometric data. Before calling this API it is mandatory to call the start capture API and it should have returned success. The certificate chain passed should be a proper trusted certificate otherwise chain of trust will fail. The PID passed as input can have optionally filled demographics, OTP or other biometric data like FMR, FIR. This API will take care of inserting the iris biometric data and return the complete encrypted PID. A sample input pid without any demographics or PIN/OTP is given below for XML and Protobuf. The return value will have to be base64 encoded for using in auth request as shown below.
private byte[] getPIDXML() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZZ", Locale.US); sdf.setTimeZone(TimeZone.getTimeZone("UTC+5.30")); String timestamp = sdf.format(new Date()); String pid = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<ns2:Pid xmlns:ns2=\"http://www.uidai.gov.in/authentication/uid-auth-request-data/1.0\" " + "ts=\""+ timestamp + "\">" + "<Bios>" + "</Bios>" + "</ns2:Pid>"; byte[] piddata = pid.getBytes(); return piddata; } private byte[] getPIDProtoBuf(){ in.gov.uidai.authserver.protobuf.Auth.Pid.Builder pidBuilder = Auth.Pid.newBuilder(); Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZZ", Locale.US); sdf.setTimeZone(TimeZone.getTimeZone("UTC+5.30")); String timestamp = sdf.format(date); pidBuilder.setTs(timestamp); pidBuilder.setVer("1.0"); in.gov.uidai.authserver.protobuf.Auth.Pid pid = pidBuilder.build(); return pid.toByteArray(); } byte[] inputpiddata = isProtoBuf ? getPIDProtoBuf(): getPIDXML(); int inputpidtype = isProtoBuf ? SecIrisConstants.PIDTYPE_PROTOBUF: SecIrisConstants.PIDTYPE_XML; int biotype = isSingleEye ? SecIrisConstants.BIOTYPE_UNKNOWN_IRIS: SecIrisConstants.BIOTYPE_BOTH_IRIS; SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { byte[] encryptedpid = mSecIris.getEncryptedPidBuffer(inputpiddata, inputpidtype, biotype, mCertChain); String encryptedencodedpid = Base64.encodeToString(encryptedpid, Base64.DEFAULT); String datatag = "<Data " + "type=\"X\">" + encryptedencodedpid + "</Data>"; } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |
This API returns the encrypted session key.
LicenseRequiredException | If caller does not have the required permissions. |
---|---|
DeviceTamperedException | If device is rooted. |
NeedsCaptureException | In case the API is called without doing a prior successful capture. |
A third party ISV app can use this API to get the encrypted session key returned as byte array. The byte array should be base64 encoded to use in authenticate request.
SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { byte[] encryptedsessionkey = mSecIris.getEncryptedSessionKey(); String encryptedencodedsessionkey = Base64.encodeToString(encryptedsessionkey, Base64.DEFAULT); String sessionkeytag = "<Skey " + "ci=\"" + certIdentifier + "\">" + encryptedencodedsessionkey + "</Skey>"; } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |
gets the instance of iris manager. This is a singleton class and you will be accessing the same object throughout the lifecycle of your app.
RuntimeException | In case the device does not support the Samsung India Identity SDK. |
---|
API to register for a callback to receive the iris capture events.
LicenseRequiredException | If caller does not have required permissions |
---|
A third party ISV application can use this API to register for a callback to receive iris capture events.
SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { mSecIris.registerCallback(callback); } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |
API to start the iris capture.
numEyes | Number of eyes to be captured. single(1) or dual eyes(2) |
---|
LicenseRequiredException | If caller does not have required permissions |
---|---|
DeviceTamperedException | If device is rooted |
A third party ISV application can use this API to start iris capture.
SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { int errorcode = mSecIris.startCapture(numEyes); } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |
API to stop or cancel the iris capture.
LicenseRequiredException | If caller does not have required permissions |
---|---|
DeviceTamperedException | If device is rooted |
A third party ISV app can use this API to stop or cancel the iris capturing. It can be called whenever the app is paused. API will not throw any exception or error in case it is called multiple times.
SecIrisManager mSecIris = SecIrisManager.getSecIrisManager(mContext); try { int errorcode = mSecIris.stopCapture(); } catch (LicenseRequiredException e) { Log.w(TAG, "LicenseRequiredException: " + e); } |