BlockIDSDK
public class BlockIDSDK extends NSObject
This class is the entry point of BlockID SDK and used to do the initial setup required for the SDK and to access all of its features.
Field Summary
| Parameters | ||
|---|---|---|
| static BlockIDSDK | sharedInstance | Singleton instance of BlockIDSDK. |
Method Summary
| Parameters | ||
|---|---|---|
| void | addPreLinkedUser(userId: String, origin: BIDOrigin, account: BIDAccount?, completion: @escaping UserAPICallback) | Provides an option to add already linked user. |
| void | authenticatePasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback) | Authenticate using passkey. |
| void | authenticateUser(sessionId: String?, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback) | Authenticate user with preset data (UWL1.0). |
| void | authenticateUser(sessionId: String?, sessionURL: String, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin), userId: String? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback | Authenticate user with preset data (UWL2.0). |
| void | authenticateUser(sessionId: String?, creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, extraData: [String: Any]? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback) | Authenticate user with scope (UWL1.0). |
| void | authenticateUser(controller: UIViewController? = nil, sessionId: String?, sessionURL: String, creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, extraData: [String: Any]? = nil, authFactor: String? = nil, isRejected: Bool = false, completion: @escaping AuthenticateUserCallback) | Authenticate user with scope (UWL2.0). |
| void | validateAccessCode(code: String, origin: BIDOrigin, completion: @escaping AccessCodeValidationAPICallback) | Check validity of access code. The access code validation is required during access code redemption process. |
| Bool | checkDeviceTrust() | Checks and indicates if the devices can be trusted. |
| Bool | checkUserExist(userId: String, origin: BIDOrigin, completion: @escaping (Bool) -> ()) | Check if the user exists with the given userid and origin. |
| void | commitApplicationWallet() | Commits the application wallet if tenant registration is successful. |
| void | createDocumentSession(docType: DocumentScannerType, dvcId: String? = nil, uid: String? = nil, completion: @escaping DocumentSessionCallback) | Generate Document Scan Session. |
| String | decryptString(str: String, senderKey: String) | Performs decryption of data with the given public key. |
| String | encryptString(str: String, rcptKey: String) | Performs encryption of data with the given public key. |
| void | fetchDocuments(requestDict: [String: Any], _ completion: @escaping FetchDocumentsCallback) | Fetches and returns user documents from server. |
| void | fetchCommunityConfig(_ tenant: BIDTenant, _ keyPath: String, completion: @escaping FetchConfigCallback) | Fetches & returns Community Level Configurations. |
| void | fetchConfig(_ tenantDNS: String, _ keyPath: String? = nil, completion: @escaping FetchConfigCallback) | Fetches & returns Global Configuration. |
| void | fetchUserByUserName(tenant: BIDTenant, userName: String, completion: @escaping FetchUserResponseCallBack) | Fetch user account info by user name. |
| void | updateOTPSeedsForAccounts(accounts: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback) | Updates OTP seeds for Accounts. |
| void | updateOTPSeedForSingleAccount(account: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback) | Updates OTP seeds for single account. |
| void | emptyOTPSeedsForAccounts(completion: @escaping EmptyOTPSeedsForAccountsCallback) | Empty OTP Seeds for all accounts. |
| BIDTenant | getAppTenant() | Returns registered app tenant object. |
| BiometricAssets | getBiometricAssetEnrollments() | Returns registered biometric assets (Pin, Face ID / Touch ID, Live ID) |
| Bool | generateWalletForRestore() | Returns true/false status if temporary wallet is created for restore. |
| String | getDID() | Get DID of application. DID is a unique Distributed IDentifier. |
| DigitalAssets | getDigitalAssetEnrollments() | Returns list of all registered digital assets. |
| String | getIAL(completion: @escaping IALCallback) | Returns the current IAL (Identity Assurance Level) for the user. |
| void | getKYC(completion: @escaping KYCCallback) | Returns the KYC hash string value. |
| (BIDLicense, ErrorResponse) | getLicense() | Returns the license module setup for the given tenant. |
| (BIDLinkedAccount, ErrorResponse) | getLinkedUserAccounts() | Returns a list of all the users linked to the given DID (Distributed Identifier). |
| UIImage | getLiveIDImage() | Returns the registered Live ID image of the user. |
| void | getMessageGateways(tenant: BIDTenant, completion: @escaping MessageGatewaysCallback) | Returns a list of available message gateways for the given tenant |
| String | getMnemonicPhrases() | Returns 12 Mnemonic Phrases. Used for future restoration of a wallet |
| void | getPasswordPolicy(account: BIDLinkedAccount, completion: @escaping PasswordPolicyCallback) | Fetches password policy for BIDLinkedAccount. |
| ProxyDetails | getProxyDetails() | Returns proxy details. |
| void | getRemovedAccountList(completion: @escaping UserAccountsRemovedCallback) | Returns orphan accounts if any removed. |
| String | getWalletPublicKey() | Returns application wallet public key. |
| ([String: Any]?, ErrorResponse?) | getScopesAttributesDic(scopes: String, creds: String, origin: BIDOrigin, userId: String? = nil, completion: @escaping ([String: Any]?, ErrorResponse?) -> Void) | Returns user data based on defined scopes (e.g. firstName, ial, dl_object). |
| (BIDLinkedAccount?, ErrorResponse?) | getCurrentUserAccount() | Returns the selected user account. |
| String | getServerPublicKey() | Returns server public key of registered tenant. |
| void | getSessionResponse(completion: @escaping SessionResponseCallback) | Get session response for a particular session URL and sessionID. |
| BIDTenant | getTenant() | Returns root of registered app tenant object. |
| (TOTP, ErrorResponse) | getTOTP() | Returns time based OTP value. |
| void | getVCsFrom(downloadURL url: String, completion: @escaping VCsCallback) | Returns VC data from download URL |
| void | getVP(_ dictVCObj: [String: Any], completion: @escaping VPCallback) | Returns VP object based on VC data } |
| String | getVersion() | Returns BlockID SDK version. |
| void | initiateTempWallet(completion: @escaping BIDWalletCreationCallback) | Initializes and creates temporary application wallet. The wallet contains DID, 12 Mnemonic Phrases, Public Key, and Private Key. |
| Bool | isBiometricEnrollmentUpdated() | Checks if the biometrics has been updated after the enrollement. |
| Bool | isDeviceAuthRegistered() | Checks and indicates if user has setup biometric option for login purpose. |
| Bool | isLiveIDRegistered() | Checks and indicates if user has registered Live ID. |
| Bool | isPinRegistered() | Checks and indicates if user has setup (registered) login Pin. |
| Bool | isReady() | Checks and indicates if the SDK is ready for use. BlockIDSDK must be ready before using any functions of SDK. |
| Bool | isRestoreModeOn() | Checks and indicates id the restore mode is set to true. |
| Bool | isRestoreWalletEnabled(forTenant dns:String, completion: @escaping (Bool)) -> () | Returns true/false if Wallet Restoration is enabled or not. |
| void | issueJWTOnPasskeyAuthentication(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback) | Issue JWT using passkey Authentication. |
| void | pollDocumentSession(sessionId: String, dvcId: String? = nil, completion: @escaping PollSessionCallback) | Poll Document Scan Session to get scanned document result. |
| Bool | isTrustedSessionSources(sessionUrl: String, callback: @escaping (Bool) -> Void) | Checks and indicates if the given session URL is trusted by BlockID SDK. |
| void | registerDocument(obj: [String: Any], liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback) | Store (add) the given document data along with Live ID. |
| void | registerDocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback) | Store (add) the given document data along with Live ID. This method must should be used IF you do not want to store and/or sync your document data on BlockID platform. |
| void | registerDocument(obj: [String: Any], sigToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback) | Store (add) the given document data. |
| void | registerDocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, signToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback) | Store (add) the given document data. This method must should be used IF you do not want to store and/or sync your document data on BlockID platform. |
| void | registerPasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback) | Registers passkey |
| void | registerPasskeyWithAccountLinking(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback) | Registers passkey with account linking. |
| void | registerTenant(tenant: BIDTenant, completion: @escaping BIDTenantRegisterationCallback) | Sets application tenant details in SDK. Tenant details must be set once. Make sure to register tenant call one time because tenant details are set only one time. |
| void | resetPassword(userId: String, password: String, account: BIDAccount?, origin: BIDOrigin, completion: @escaping UserAPICallback) | Resets user password. |
| void | resetRestorationData() | Resets all restoration data. |
| void | resetSDK(licenseKey: String, rootTenant: BIDTenant, reason: String) -> Void | Purges the SDK wallet and all data stored/owned by the SDK. |
| void | restoreUserDataFromWallet(completion: @escaping UserAPICallback) | Performs user data restoration from application's wallet. |
| void | restoreWalletWithLiveID(controller: UIViewController, rootTenantDNS: String, communityName: String, dvcID: String? = nil, completion: @escaping RestoreWalletWithLiveIDCallback) | Restore the wallet using LiveID. |
| void | setCurrentUserAccount(account: BIDLinkedAccount) | Sets an user's linked account as currently selected account. |
| void | setDvcID(dvcID: String) | Sets application's dvcID (Document Verification Connector Identifier). |
| void | setLicenseKey(key: String) | Sets application's license key. |
| void | setLinkedAccountsJSON(accountsJSON: String) | Set Accounts JSON in the SDK's local storage. |
| void | setLiveID(liveIdImage: UIImage , liveIdProofedBy: String? = nil, sigToken: String? = nil, livenessResult: String?, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback) | Register (store) user's Live ID data. |
| void | setProxy(host: String, port: Int, userName: String, password: String, isHTPPOnly: Bool) | Add proxy to all the outbound API calls used within the SDK. |
| void | setRestoreMode() | Sets user's account restore mode to true. |
| void | setPin(pin: String, proofedBy: String, completion: @escaping UserAPICallback) | Registers Pin for login purpose. |
| void | removePin(pin: String, completion: @escaping UserAPICallback) | Remove (delete) the existing Pin. |
| void | unLinkAccount(bidLinkedAccount: BIDLinkedAccount, deviceToken: String? = nil, completion: @escaping UserAPICallback) | Unlink the existing user account. |
| void | unregisterDocument(dictDoc: [String: Any], completion: @escaping UserAPICallback) | Remove (delete) the existing document. |
| void | updateAccountInfo(account: BIDLinkedAccount, pushID: String? = nil, deviceInfo: [String: Any], completion: @escaping UpdateAccInfoCallback) | This function is used to update unique origin with device pushID and deviceInfo to server to start getting push notifications after restoring data and accounts to a new device |
| void | updateAccounts(accounts: [BIDLinkedAccount]) | This function updates the account list stored in SDK local storage. |
| void | verifyDocument(dvcID: String? = nil, dic: [String: Any], verifications: [String], mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping ((Bool, [String: Any]?, ErrorResponse?) -> Void)) | Verify document data (that the user has presented) through our partners. |
| void | verifyFaceWithLiveness(image: UIImage, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback) | Verifies the face against the enrolled LiveID. A liveness check is performed on the provided image, followed by a comparison with the enrolled LiveID. |
| void | verifyLiveID(image: UIImage, sigToken: String? = nil, livenessResult: String?, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback) | Verify Live ID. |
| Bool | verifyPin(pin: String) | Returns if the given is verified. |
| void | verifyUserAccount(userId: String, password: String, origin: BIDOrigin, deviceToken: String? = nil, lat: Double, lon: Double, completion: @escaping UserAPICallback) | Verify onborded user account using AD Password. |
Method Details
addPreLinkedUser
public func addPreLinkedUser(userId: String, origin: BIDOrigin, account: BIDAccount?, completion: @escaping UserAPICallback)
- Provides an option to add already linked users.
| Parameters | ||
|---|---|---|
| userId | String | UserID of user's account. |
| origin | BIDOrigin | User account origin details. |
| account | BIDAccount | An object of BIDAccount. |
| callback | UserAPICallback | The block to execute after the response is received. |
authenticatePasskey
public func authenticatePasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)
- Authenticate using passkey.
| Parameter | Description |
|---|---|
| controller | UIViewController: Current controller |
| passkeyRequest | PasskeyRequest: The passkey request object containing BIDTenant, userName, displayName |
| completion | PasskeyCallback: The block to execute after the response is received. |
authenticateUser
public func authenticateUser(sessionId: String?, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback)
- Authenticate user with preset data (UWL1.0).
| Parameter | |
|---|---|
| sessionId | String: Session for authentication. |
| creds | String: Credential of user's account. |
| dictScopes | Dictionary: Authentication data. |
| lat | Double: Latitude of user's location. |
| lon | Double: Longitude of user's location. |
| origin | BIDOrigin: Origin details of user. |
| userId | String: UserID of user's account. |
| authFactor | String: Performed authentication using which authentication type. |
| completion | AuthenticateUserCallback: The block to execute after the response is received. |
authenticateUser
public func authenticateUser(sessionId: String?, sessionURL: String, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback)
- Authenticate user with preset data (UWL2.0).
| Parameter | |
|---|---|
| sessionId | String: Session for authentication. |
| sessionUrl | String: Complete session URL containing sessionId. |
| creds | String: Credential of user's account. |
| dictScopes | Dictionary: Authentication data. |
| lat | Double: Latitude of user's location. |
| lon | Double: Longitude of user's location. |
| origin | BIDOrigin: Origin details of user. |
| userId | String: UserID of user's account. |
| authFactor | String: Performed authentication using which authentication type. |
| completion | AuthenticateUserCallback: The block to execute after the response is received. |
authenticateUser
public func authenticateUser(sessionId: String?, creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, extraData: [String: Any]? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallback)
- Authenticate user with scope (UWL1.0).
| Parameter | |
|---|---|
| sessionId | String: Session for authentication. |
| creds | String: Credential of user's account. |
| scopes | String: Scopes defined for authentication |
| lat | Double: Latitude of user's location. |
| lon | Double: Longitude of user's location. |
| origin | BIDOrigin: Origin details of user. |
| userId | String: UserID of user's account. |
| metaData | [String: Any]: Metadata for sign nonce payload |
| extraData | [String: Any]:Dictionary object |
| authFactor | String: Performed authentication using which authentication type |
| completion | AuthenticateUserCallback: The block to execute after the response is received. |
authenticateUser
public func authenticateUser(controller: UIViewController? = nil, sessionId: String?, sessionURL: String, creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, extraData: [String: Any]? = nil, authFactor: String? = nil, isRejected: Bool = false, completion: @escaping AuthenticateUserCallback)
- Authenticate user with scope (UWL2.0).
| Parameter | |
|---|---|
| controller | UIViewController: Current UIViewController object |
| sessionId | String: Session for authentication. |
| sessionUrl | String: Complete session URL containing sessionId. |
| creds | String: Credential of user's account. |
| scopes | String: Scopes defined for authentication |
| lat | Double: Latitude of user's location. |
| lon | Double: Longitude of user's location. |
| origin | BIDOrigin: Origin details of user. |
| userId | String: UserID of user's account. |
| metaData | [String: Any]:Dictionary object to FIDO sign in |
| extraData | [String: Any]:Dictionary object |
| authFactor | String: Performed authentication using which authentication type |
| isRejected | Bool: Indicates whether authentication was rejected. This parameter is optional, and the default value is false. - true: Authentication is rejected. The SDK will not resolve scopes and will only return DID, publicKey, and userId. - false: Authentication succeeds, and scopes are resolved normally. |
| completion | AuthenticateUserCallback: The block to execute after the response is received. |
validateAccessCode
public func validateAccessCode(code: String, origin: BIDOrigin, completion: @escaping AccessCodeValidationAPICallback)
- Check validity of access code. The access code validation is required during access code redemption process.
| Parameter | |
|---|---|
| code | String: Access code to be validated. |
| origin | BIDOrigin: Tenant tag. |
| completion | AccessCodeValidationAPICallback: The block to execute after the response is received. |
checkDeviceTrust
public func checkDeviceTrust() -> Bool
- Checks and indicates if the device is trusted.
checkUserExist
public func checkUserExist(userId: String, origin: BIDOrigin, completion: @escaping (Bool) -> ())
- Check if the user exists with the given userid and origin.
commitApplicationWallet
public func commitApplicationWallet()
- Commits the application's wallet IFF tenant registration is successful.
createDocumentSession
public funccreateDocumentSession(docType: DocumentScannerType, dvcId: String? = nil, uid: String? = nil, completion: @escaping DocumentSessionCallback)
- Generate Document Scan Session
| Parameter | |
|---|---|
| docType | DocumentScannerType: Type of document |
| dvcId | String: (Optional) Document Verification Connector Identifier |
| uid | String: (Optional) UID (Unique ID by using it you can filter in AdminX→Verifications). |
| completion | DocumentSessionCallback: The block to execute after the response is received. |
decryptString
public func decryptString(str: String, senderKey: String) -> String?
- Performs decryption of data with the given public key.
| Parameters | ||
|---|---|---|
| str | String | Data to decrypt. |
| senderKey | String | Public key used to decrypt the data. |
encryptString
public func encryptString(str: String, rcptKey: String) -> String?
- Performs encryption of data with the given public key.
| Parameters | ||
|---|---|---|
| inputData | String | Data to encrypt. |
| senderKey | String | Public key used to encrypt the data. |
fetchDocuments
public func fetchDocuments(requestDict: [String: Any], _ completion: @escaping FetchDocumentsCallback)
- Fetches & returns user documents from server
| Parameter | |
|---|---|
| requestDict | [String: Any]: Dictionary of document ids. |
| completion | FetchDocumentsCallback: Callback that returns documents dictionary. |
| Request Dictionary Parameter | |
|---|---|
| categories | [String]: Document category to fetch (ex. identity_document, misc_document) |
| id | [String]: Document ID to fetch |
| type | [String]: Document Type to fetch (ex. dl, ppt, nationalid, ssn) |
| metadataOnly | bool true: Get metadata only false: Get metadata and actual document data Example metadata: { "type": "dl", "id": "12345", "proofedBy": "blockid", "category": "identity_document", "doe": "20001029", "proofs": ["any proof if present"] } |
fetchCommunityConfig
public func fetchCommunityConfig(_ tenant: BIDTenant, _ keyPath: String, completion: @escaping FetchConfigCallback)
- Fetches & returns Community Level Configurations
| Parameter | |
|---|---|
| tenantDNS | BIDTenant: Tenant Object. |
| keyPath | String: key path (ex. applications.mobile) |
| completion | FetchConfigCallback: Callback that returns community configuration. |
fetchConfig
public func fetchConfig(_ tenantDNS: String, _ keyPath: String? = nil, completion: @escaping FetchConfigCallback)
Fetch global configuration to find restorable accounts.
| Parameter | |
|---|---|
| tenantDNS | String: Tenant DNS. |
| keyPath | String: key path |
| completion | FetchConfigCallback: Callback that returns global configuration. |
updateOTPSeedsForAccounts
public func updateOTPSeedsForAccounts(accounts: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback)
Fetch user account info and update otp seeds for accounts
| Parameter | |
|---|---|
| accounts | BidLinkedAccount: List of BIDLinkedAccount objects. |
| completion | OTPSeedUpdatedCallback: The block to execute after the response is received |
emptyOTPSeedsForAccounts
public func emptyOTPSeedsForAccounts(completion: @escaping EmptyOTPSeedsForAccountsCallback)
Fetch user account info and update otp seeds null for all accounts.
| Parameter | |
|---|---|
| completion | EmptyOTPSeedsForAccountsCallback: The block to execute after the response is received. |
updateOTPSeedForSingleAccount
public func updateOTPSeedForSingleAccount(account: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback)
Fetch user account info and update otp seeds for single account.
| Parameter | |
|---|---|
| account | BIDLinkedAccount: object of BIDLinkedAccount. |
| completion | OTPSeedUpdatedCallback: The block to execute after the response is received. |
fetchUserByUserName
public func fetchUserByUserName(tenant: BIDTenant, userName: String, completion: @escaping FetchUserResponseCallBack)
- Fetch user account info by user name.
| Parameter | |
|---|---|
| tenant | BIDTenant: BIDTenant Object |
| userName | String: User Name |
| completion | FetchUserResponseCallBack: The block to execute after the response is received. |
getAppTenant
public func getAppTenant() -> BIDTenant?
- Returns registered app tenant object.
getBiometricAssetEnrollments
public func getBiometricAssetEnrollments() -> BiometricAssets?
Returns registered biometric assets (Pin, Face ID / Touch ID, Live ID).
generateWalletForRestore
public func generateWalletForRestore() -> Bool
Returns true/false status if temporary wallet is created for restore.
getDID
public func getDID() -> String
- Get DID of application. DID is a unique Distributed IDentifier.
getDigitalAssetEnrollments
public func getDigitalAssetEnrollments() -> DigitalAssets?
- Returns list of all registered digital assets.
getIAL
public func getIAL(completion: @escaping IALCallback) → Void
- Get the current IAL (Identity Assurance Level) of the user.
getKYC
public func getKYC(completion: @escaping KYCCallback) -> Void
Returns the KYC hash string value.
getLicense
public func getLicense() -> (license: BIDLicense?, error: ErrorResponse?)
- Returns license modules set up for a given tenant.
getLinkedUserAccounts
public func getLinkedUserAccounts() -> (linkedUsers: [BIDLinkedAccount]?, error: ErrorResponse?)
- Returns a list of all users linked to DID (Distributed Identifier).
getLiveIDImage
public func getLiveIDImage() -> UIImage?
- Returns registered Live ID image of the user
getMessageGateways
public func getMessageGateways(tenant: BIDTenant, completion: @escaping MessageGatewaysCallback) -> Void
- Get list of message gateway available for given tenant.
| Parameters | ||
|---|---|---|
| tenant | BIDTenant | Tenant details |
| completion | MessageGatewaysCallback | The block to execute after the response is received |
getMnemonicPhrases
public func getMnemonicPhrases() -> String?
- Returns 12 Mnemonic Phrases. Used for the restoration of a wallet in the future.
getPasswordPolicy
public func getPasswordPolicy(account: BIDLinkedAccount, completion: @escaping PasswordPolicyCallback)
Fetches password policy for an account.
| Parameter | |
|---|---|
| account | BIDLinkedAccount: Linked user's account |
| completion | PasswordPolicyCallback: Call back listener to return response once API execution completes. |
getProxyDetails
public func getProxyDetails() -> ProxyDetails?
- Returns proxy details.
getRemovedAccountList
public func getRemovedAccountList(completion: @escaping UserAccountsRemovedCallback)
Returns orphan accounts if any are removed.
| Parameter | |
|---|---|
| completion | UserAccountsRemovedCallback: Call back listener to return response once API execution completes. |
getWalletPublicKey
public func getWalletPublicKey() -> String
- Returns the application wallet's public key.
getScopesAttributesDic
public func getScopesAttributesDic(scopes: String, creds: String, origin: BIDOrigin, userId: String? = nil, completion: @escaping ([String: Any]?, ErrorResponse?) -> Void) Returns user's data based on defined scopes (e.g. firstName, ial, dl_object).
| Parameters | |
|---|---|
| scopes | String: Comma separated scopes. |
| creds | String: User's credentials. |
| origin | BIDOrigin: Origin details of user. |
| userId | String: UserID of user account. |
| completion | Dictionary, ErrorResponse: [String: Any], ErrorResponse |
getCurrentUserAccount
public func getCurrentUserAccount() -> (currentUser: BIDLinkedAccount?, error: ErrorResponse?)
- Returns the selected user account.
getServerPublicKey
public func getServerPublicKey() -> String
- Returns server public key of a registered tenant.
getSessionResponse
public func getSessionResponse(completion: @escaping SessionResponseCallback)
- Get session response for a particular session URL and sessionID.
| Parameters | ||
|---|---|---|
| completion | SessionResponseCallback | The block to execute after the response is received. |
getTenant
public func getAppTenant() -> BIDTenant?
Returns root of registered app tenant object.
getTOTP
public func getTOTP() -> (totp: TOTP?, error: ErrorResponse?)
- Returns time-based OTP value.
getVC
public func getVCsFrom(downloadURL url: String, completion: @escaping VCsCallback)
- Returns VC data from download URL
| Parameters | |
|---|---|
| downloadURL | String: Download URL. |
| completion | VCsCallback: The block to execute after the response is received. |
getVP
public func getVP(_ dictVCObj: [String: Any], completion: @escaping VPCallback)
- Returns VP object based on VC data
| Parameters | |
|---|---|
| vcData | dictVCObj: VC Data for which VP has to be created |
| completion | VPCallback: The block to execute after the response is received. |
getVersion
public func getVersion() -> String?
- Returns BlockID SDK version.
initiateTempWallet
public func initiateTempWallet(completion: @escaping BIDWalletCreationCallback)
- Initializes and creates a temporary application wallet. The wallet contains DID, 12 Mnemonic Phrases, Public Key, and Private Key.
isBiometricEnrollmentUpdated
public func isBiometricEnrollmentUpdated() -> Bool
is device biomatric updated after enrollment.
isDeviceAuthRegistered
public func isDeviceAuthRegistered() -> Bool
- Checks and indicates if the user has set up a biometric option for login purposes.
isLiveIDRegistered
public func isLiveIDRegistered() -> Bool
- Checks and indicates if the user has registered Live ID.
isPinRegistered
public func isPinRegistered() -> Bool
- Checks and indicates if the user has set up (registered) login Pin.
isReady
public func isReady() -> Bool
- Checks and indicates if the SDK is ready for use. BlockIDSDK must be ready before using any functions of SDK.
isRestoreModeOn
public func isRestoreModeOn() -> Bool
- Checks and indicates if the restore mode is set to true.
isRestoreWalletEnabled
public func isRestoreWalletEnabled(forTenant dns:String, completion: @escaping (Bool)) -> ()
- Returns true/false if Wallet Restoration is enabled or not.
issueJWTOnPasskeyAuthentication
public func issueJWTOnPasskeyAuthentication(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)
- Issue JWT using passkey Authentication
| Parameter | |
|---|---|
| controller | UIViewController: Current controller |
| passkeyRequest | PasskeyRequest: The passkey request object containing BIDTenant, userName |
| completion | PasskeyCallback: The block to execute after the response is received. |
isTrustedSessionSources
public func isTrustedSessionSources(sessionUrl: String, callback: @escaping (Bool) -> Void)
- Checks and indicates if the given session URL is trusted by BlockID SDK.
| Parameters | ||
|---|---|---|
| sessionUrl | String | Session URL to be verified from a list of a trusted sources. |
| callback | @escaping (Bool): The block to execute after the response is received. |
pollDocumentSession
public func pollDocumentSession(sessionId: String, dvcId: String? = nil, completion: @escaping PollSessionCallback)
- Poll Document Scan Session to get scanned document result.
| Parameter | |
|---|---|
| sessionId | String: Session ID for which polling has to be done. |
| dvcId | String: Document Verification Connector Identifier. |
| completion | PollSessionCallback: The block to execute after the response is received. |
registerDocument
public func registerDocument(obj: [String: Any], liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback)
- Store (add) the given document data along with Live ID.
| Parameters | ||
|---|---|---|
| obj | Dictionary | Document data to be stored. |
| liveIdProofedBy | String | The entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid". |
| docSignToken | String | Signature token of the document to verify if the document data is modified or not. |
| faceImage | UIImage | Live ID image to be stored. |
| liveIDSignToken | String | Signature token of Live ID to verify if the Live ID is modified or not. |
| mobileSessionId | String | (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String | (Optional) Unique Document ID that can be used for event tracking or validation purposes. |
| completion | UserAPICallback | The block to execute after the response is received. |
registerDocument
public func registerDocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback)
- Store (add) the given document data along with Live ID. This method must be used IF you do not want to store and/or sync your document data on the BlockID platform.
| Parameters | ||
|---|---|---|
| obj | Dictionary | Document data to be stored. |
| storeArtifacts | Bool | Flag to indicate if the document must be stored in local storage. |
| syncArtifacts | Bool | Flag to indicate if the document must be synced with IPFS on the BlockID platform. |
| liveIdProofedBy | String | The entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid". |
| docSignToken | String | Signature token of the document to verify if the document data is modified or not. |
| faceImage | UIImage | Live ID image to be stored. |
| liveIDSignToken | String | Signature token of Live ID to verify if the Live ID is modified or not. |
| mobileSessionId | String | (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String | (Optional) Unique Document ID that can be used for event tracking or validation purposes. |
| completion | UserAPICallback | The block to execute after the response is received. |
registerDocument
public func registerDocument(obj: [String: Any], sigToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback)
- Store (add) the given document data.
| Parameter | ||
|---|---|---|
| obj | Dictionary | Document data to be stored. |
| sigToken | String | Signature token of the document to verify if the document data is modified or not. |
| mobileSessionId | String | (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String | (Optional) Unique Document ID that can be used for event tracking or validation purposes. |
| completion | UserAPICallback | The block to execute after the response is received. |
registerDocument
public func registerDocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, signToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback)
- Store (add) the given document data. This method must be used IF you do not want to store and/or sync your document data on the BlockID platform.
| Parameters | ||
|---|---|---|
| obj | Dictionary | Document data to be stored. |
| storeArtifacts | Bool | Flag to indicate if the document must be stored in local storage. |
| syncArtifacts | Bool | Flag to indicate if the document must be synced with IPFS on the BlockID platform. |
| sigToken | String | Signature token of the document to verify if the document data is modified or not. |
| mobileSessionId | String | (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String | (Optional) Unique Document ID that can be used for event tracking or validation purposes. |
| completion | UserAPICallback | The block to execute after the response is received. |
registerPasskey
public func registerPasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)
- Register passkey.
| Parameter | |
|---|---|
| controller | UIViewController: Current controller |
| passkeyRequest | PasskeyRequest: The passkey request object containing BIDTenant, userName, displayName |
| completion | PasskeyCallback: The block to execute after the response is received. |
public func registerPasskeyWithAccountLinking
registerPasskeyWithAccountLinking(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)
- Register passkey with account linking.
| Parameter | |
|---|---|
| controller | UIViewController: Current controller |
| passkeyRequest | PasskeyRequest: The passkey request object containing BIDTenant, userName, deviceName |
| completion | PasskeyCallback: The block to execute after the response is received. |
registerTenant
public func registerTenant(tenant: BIDTenant, completion: @escaping BIDTenantRegisterationCallback)
- Sets application tenant details in SDK. Tenant details must be set once. Make sure to register tenant call one time because tenant details are set only one time.
| Parameters | ||
|---|---|---|
| tenant | BIDTenant | Tenant details. |
| callback | BIDTenantRegisterationCallback | The block to execute after the response is received. |
resetPassword
public func resetPassword(userId: String, password: String, account: BIDAccount?, origin: BIDOrigin, completion: @escaping UserAPICallback)
- Resets user's password.
| Parameter | ||
|---|---|---|
| userID | String | Userid of user's account. |
| password | String | Current password of user's account. |
| account | BIDAccount | User's account for which password reset is required. |
| origin | BIDOrigin | Origin details of user's account. |
| completion | UserAPICallback | The block to execute after the response is received. |
resetRestorationData
public func resetRestorationData()
- Resets all restoration data.
resetSDK
public func resetSDK(licenseKey: String, rootTenant: BIDTenant, reason: String) -> Void
- Purges the SDK wallet and all data stored/owned by the SDK.
| Parameter | |
|---|---|
| licenseKey | String application's license key. |
| rootTenant | BIDTenant: Tenant object sent by application |
| reason | String: The reason for which the SDK is being reset |
restoreUserDataFromWallet
public func restoreUserDataFromWallet(completion: @escaping UserAPICallback)
- Performs user data restoration from the application's wallet.
| Parameters | ||
|---|---|---|
| accountRestoreListener | UserAPICallback | The block to execute after the response is received |
restoreWalletWithLiveID
public func restoreWalletWithLiveID(controller: UIViewController, rootTenantDNS: String, communityName: String, dvcID: String? = nil, completion: @escaping RestoreWalletWithLiveIDCallback)
Restore the wallet using LiveID
| Parameter | |
|---|---|
| controller | UIViewController: Current controller |
| rootTenantDNS | String: Root tenant DNS |
| communityName | String: Root tenant community name |
| dvcID | String: Document Verification Connector Identifier (optional) |
| completion | RestoreWalletWithLiveIDCallback: The block to execute after the response is received |
setCurrentUserAccount
public func setCurrentUserAccount(account: BIDLinkedAccount)
Sets an user's linked account as currently selected account.
| Parameter | |
|---|---|
| account | BIDLinkedAccount: User's linked account. |
setDvcID
public func setDvcID(dvcID: String)
- Sets application's dvcID (Document Verification Connector Identifier).
| Parameters | ||
|---|---|---|
| dvcId | String | Application's dvcID (Document Verification Connector Identifier). |
setLicenseKey
public func setLicenseKey(key: String)
- Sets application's license key.
| Parameters | ||
|---|---|---|
| key | String | application license key. |
setLinkedAccountsJSON
public func setLinkedAccountsJSON(accountsJSON: String)
Set Accounts JSON in the SDK's local storage.
| Parameter | |
|---|---|
| accountsJSON | String: Accounts JSON string |
setLiveID
public func setLiveID(liveIdImage: UIImage , liveIdProofedBy: String? = nil, sigToken: String? = nil, livenessResult: String?, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback)
- Register (store) user's Live ID data.
| Parameters | ||
|---|---|---|
| liveIdImage | UIImage | Live ID (Selfie) image. |
| liveIdProofedBy | String | The entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid". |
| sigToken | String | Signature token to verify if the Live ID (selfie) data is modified or not. |
| livenessResult | String | JSON String result data of Liveness check. |
| mobileSessionId | String (optional) | Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String(optional) | Unique Document ID that can be used for event tracking or validation purposes. |
| completion | LiveIDCallback | The block to execute after the response is received. |
setProxy
public func setProxy(host: String, port: Int, userName: String, password: String, isHTPPOnly: Bool)
- Add proxy to all the outbound API calls used within the SDK.
| Parameters | ||
|---|---|---|
| host | String | The hostname associated with the HTTP proxy. |
| port | Int | The port number associated with the HTTP proxy. |
| userName | String | The username to be used with the proxy. |
| password | String | The password to be used with the proxy. |
| isHTPPOnly | Bool | Indicates if the proxy runs on HTTP server. |
setRestoreMode
public func setRestoreMode()
- Sets user's account restore mode to true.
setPin
public func setPin(pin: String, proofedBy: String, completion: @escaping UserAPICallback) -> Void
Register Pin for login purpose.
| Parameter | |
|---|---|
| pin | String: Pin to enroll (register) |
| proofedBy | String: This identifies the entity responsible for proofing. The default value is “blockid” |
| completion | UserAPICallback: The block to execute after the response is received. |
removePin
public func removePin(pin: String, completion: @escaping UserAPICallback)
- Removes (delete) the existing pin.
| Parameter | |
|---|---|
| pin | String: Pin to be removed. |
| completion | UserAPICallback: The block to execute after the response is received. |
unLinkAccount
public func unLinkAccount(bidLinkedAccount: BIDLinkedAccount, deviceToken: String? = nil, completion: @escaping UserAPICallback)
- Unlink the existing user account.
| Parameters | ||
|---|---|---|
| bidLinkedAccount | BIDLinkedAccount | Currently linked user account. |
| deviceToken | String | PushID (push token) of device. |
| completion | UserAPICallback | The block to execute after the response is received. |
unregisterDocument
public func unregisterDocument(dictDoc: [String: Any], completion: @escaping UserAPICallback)
- Remove (delete) the existing document.
| Parameters | ||
|---|---|---|
| dictDoc | Dictionary | Document to be removed. |
| completion | UserAPICallback | The block to execute after the response is received. |
updateAccountInfo
public func updateAccountInfo(account: BIDLinkedAccount, pushID: String? = nil, deviceInfo: [String: Any], completion: @escaping UpdateAccInfoCallback)
- This function updates the unique origin with device pushID and deviceInfo to the server to start getting push notifications after restoring data and accounts to a new device.
| Parameter | |
|---|---|
| account | BIDLinkedAccount: Account details which used to update unique origin. |
| pushID | String: iOS device push id/token. |
| deviceInfo | [String: Any]: Device Information. Device Information: uid: String // Unique uuid of device os: String // Android | iOS deviceName: String // Device name authenticatorId: String // Mobile app's bundle id authenticatorVersion: String // Mobile app's version authenticatorName: String // Mobile app's name clientIp: String // Device IP address userAgent: String // Device user agent locLat: double // Device latitude locLon: double // Device longitude |
| completion | UpdateAccInfoCallback: Callback after the request is executed. |
updateAccounts
public func updateAccounts(accounts: [BIDLinkedAccount])
This function updates the account list stored in SDK local storage.
| Parameter | |
|---|---|
| accounts | [BIDLinkedAccount]: Accounts List |
verifyDocument
public func verifyDocument(dvcID: String? = nil, dic: [String: Any], verifications: [String], mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping ((Bool, [String: Any]?, ErrorResponse?) -> Void))
Verify document data (that the user has presented) through our partners.
| Parameters | ||
|---|---|---|
| dvcID | String | Document Verification Connector Identifier. |
| dic | Dictionary | Dictionary of document data. |
| verifications | String[] | List of verification. |
| mobileSessionId | String (optional) | Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String (optional) | Unique Document ID that can be used for event tracking or validation purposes. |
| completion | ((Bool, [String: Any]?, ErrorResponse?) -> Void) | The block to execute after the response is received. |
verifyFaceWithLiveness
public func verifyFaceWithLiveness(image: UIImage, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback)
Verifies the face against the enrolled LiveID. A liveness check is performed on the provided image, followed by a comparison with the enrolled LiveID.
| Parameter | ||
|---|---|---|
| image | UIImage | Bitmap to compare with enrolled Live ID.. |
| mobileSessionId | String | (Optional) Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String (optional) | Unique Document ID that can be used for event tracking or validation purposes. |
| completion | LiveIDCallback | The block to execute after the response is received. |
verifyLiveID
public func verifyLiveID(image: UIImage, sigToken: String? = nil, livenessResult: String?, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback)
- Verifies Live ID.
| Parameters | ||
|---|---|---|
| image | UIImage | Bitmap to compare with enrolled Live ID (selfie). |
| sigToken | String | Signature token of Live ID |
| livenessResult | String | JSON String result data of Liveness check |
| mobileSessionId | String (optional) | Unique Session ID that can be used for event tracking or validation purposes. |
| mobileDocumentId | String (optional) | Unique Document ID that can be used for event tracking or validation purposes. |
| completion | LiveIDCallback | The block to execute after the response is received. |
verifyUserAccount
public func verifyUserAccount(userId: String, password: String, origin: BIDOrigin, deviceToken: String? = nil, lat: Double, lon: Double, completion: @escaping UserAPICallback)
Verify onborded user account using AD Password.
| Parameter | |
|---|---|
| userID | String: UserID of user's account. |
| password | String: Password of user's account. |
| origin | BIDOrigin: Origin details. |
| deviceToken | String: Push token of user's device. Use for sending push notifications. |
| lat | Double: Longitude of user's location. |
| lon | Double: Latitude of user's location. |
| completion | UserAPICallback: The block to execute after the response is received. |
verifyPin
public func verifyPin(pin: String) -> Bool
- Returns if the given is verified.
| Parameters | ||
|---|---|---|
| pin | String | Current Pin for verification. |
Typealias
| Parameters | ||
|---|---|---|
| AccessCodeValidationAPICallback | (Bool, ErrorResponse, AccessCodeValidationResponseDecryptedData) -> Void | Indicates when the access code validation response is received. |
| AuthenticateUserCallback | (Bool, String, ErrorResponse) -> Void | Indicates when user authentication response is received. |
| BIDTenantRegisterationCallback | (Bool, ErrorResponse, BIDTenant) -> Void | Indicates when the tenant registration is completed. |
| BIDWalletCreationCallback | (Bool, ErrorResponse) -> Void | Indicates when the wallet creation is completed. |
| OTPSeedUpdatedCallback | (Bool, [OTPSeedUpdatedAccountResult] , OTPSeedUpdateAction) -> Void | Indicates when the user's account OTP seed is updated or failed. |
| EmptyOTPSeedsForAccountsCallback | (Bool, ErrorResponse) -> Void | Indicates when the OTP Seeds are Emptied. |
| FetchUserResponseCallBack | (Bool, String, ErrorResponse) -> Void | Indicates when the session response is received. |
| DocumentSessionCallback | (_ status: Bool, _ error: ErrorResponse?,_ response: BIDDocumentSessionResponse?) -> Void | Indicates when the document session is created. |
| FetchDocumentsCallback | (_ status: Bool, _ responseDict: [String: Any]?, _ error: ErrorResponse?) -> Void | Callback that returns documents dictionary. |
| FetchConfigCallback | (_ status: Bool, _ error: ErrorResponse?, _ response: String?) -> Void | Callback that returns global or community level configurations. |
| IALCallback | ((_ status: Bool, _ ialValue: String, _ error: ErrorResponse?) -> Void) | Indicates when the IAL operation is completed. |
| KYCCallback | (_ status: Bool, _ kycHash: String?, _ error: ErrorResponse?) -> Void | Indicates when the KYC operation is completed. |
| LiveIDCallback | (Bool, ErrorResponse) -> Void | Indicates when the Live ID scanning response is received. |
| MessageGatewaysCallback | (_ status: Bool, _ object: [MessageGateway]?, _ error: ErrorResponse?) -> Void | Indicates when the list of message gateway response is received. |
| PasswordPolicyCallback | (_ status: Bool, _ response: BIDPasswordPolicy?, _ error: ErrorResponse?) | Call back listener to return response once API execution completes. |
| PollSessionCallback | (_ status: Bool, _ error: ErrorResponse?,_ response: String?) -> Void | Indicates when the session polling is completed. |
| PasskeyCallback | (_ status: Bool, _ response: PasskeyResponse?, _ error: ErrorResponse?) -> Void | The callback interface to handle the result of the passkey operation. |
| RestoreWalletWithLiveIDCallback | (_ status: Bool, _ error: ErrorResponse?) -> Void | Indicates when the restore wallet using live id verification is completed. |
| SessionResponseCallback | (Bool, String, ErrorResponse) -> Void | Indicates when the session response is received. |
| UpdateAccInfoCallback | (_ status: Bool, _ error: ErrorResponse?) -> Void | Callback that gives status after the request is executed. |
| UserAccountsRemovedCallback | (_ status: Bool, _ response: [BIDLinkedAccount]?, _ error: ErrorResponse?) -> Void | Indicates when User Account Remove call completed and returns the remove orphan account list, status and error. |
| UserAPICallback | (Bool, ErrorResponse) -> Void | Indicates when the User API response is received. |
| VCsCallback | ((_ status: Bool, _ error: ErrorResponse?, _ response: String?) -> Void) | Callback for event when VC data is received. |
| VPCallback | ((_ status: Bool, _ error: ErrorResponse?, _ response: String?) -> Void) | Callback for event when VP data is received. |