Skip to main content

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 BlockIDSDKsharedInstanceSingleton instance of BlockIDSDK.

Method Summary​

Parameters
voidaddPreLinkedUser(userId: String, origin: BIDOrigin, account: BIDAccount?, completion: @escaping UserAPICallback)Provides an option to add already linked user.
voidauthenticatePasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)Authenticate using passkey.
voidauthenticateUser(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).
voidauthenticateUser(sessionId: String?, sessionURL: String, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin), userId: String? = nil, authFactor: String? = nil, completion: @escaping AuthenticateUserCallbackAuthenticate user with preset data (UWL2.0).
voidauthenticateUser(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).
voidauthenticateUser(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).
voidvalidateAccessCode(code: String, origin: BIDOrigin, completion: @escaping AccessCodeValidationAPICallback)Check validity of access code. The access code validation is required during access code redemption process.
BoolcheckDeviceTrust()Checks and indicates if the devices can be trusted.
BoolcheckUserExist(userId: String, origin: BIDOrigin, completion: @escaping (Bool) -> ())Check if the user exists with the given userid and origin.
voidcommitApplicationWallet()Commits the application wallet if tenant registration is successful.
voidcreateDocumentSession(docType: DocumentScannerType, dvcId: String? = nil, uid: String? = nil, completion: @escaping DocumentSessionCallback)Generate Document Scan Session.
StringdecryptString(str: String, senderKey: String)Performs decryption of data with the given public key.
StringencryptString(str: String, rcptKey: String)Performs encryption of data with the given public key.
voidfetchDocuments(requestDict: [String: Any], _ completion: @escaping FetchDocumentsCallback)Fetches and returns user documents from server.
voidfetchCommunityConfig(_ tenant: BIDTenant, _ keyPath: String, completion: @escaping FetchConfigCallback)Fetches & returns Community Level Configurations.
voidfetchConfig(_ tenantDNS: String, _ keyPath: String? = nil, completion: @escaping FetchConfigCallback)Fetches & returns Global Configuration.
voidfetchUserByUserName(tenant: BIDTenant, userName: String, completion: @escaping FetchUserResponseCallBack)Fetch user account info by user name.
voidupdateOTPSeedsForAccounts(accounts: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback)Updates OTP seeds for Accounts.
voidupdateOTPSeedForSingleAccount(account: BIDLinkedAccount, completion: @escaping OTPSeedUpdatedCallback)Updates OTP seeds for single account.
voidemptyOTPSeedsForAccounts(completion: @escaping EmptyOTPSeedsForAccountsCallback)Empty OTP Seeds for all accounts.
BIDTenantgetAppTenant()Returns registered app tenant object.
BiometricAssetsgetBiometricAssetEnrollments()Returns registered biometric assets (Pin, Face ID / Touch ID, Live ID)
BoolgenerateWalletForRestore()Returns true/false status if temporary wallet is created for restore.
StringgetDID()Get DID of application. DID is a unique Distributed IDentifier.
DigitalAssetsgetDigitalAssetEnrollments()Returns list of all registered digital assets.
StringgetIAL(completion: @escaping IALCallback)Returns the current IAL (Identity Assurance Level) for the user.
voidgetKYC(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).
UIImagegetLiveIDImage()Returns the registered Live ID image of the user.
voidgetMessageGateways(tenant: BIDTenant, completion: @escaping MessageGatewaysCallback)Returns a list of available message gateways for the given tenant
StringgetMnemonicPhrases()Returns 12 Mnemonic Phrases. Used for future restoration of a wallet
voidgetPasswordPolicy(account: BIDLinkedAccount, completion: @escaping PasswordPolicyCallback)Fetches password policy for BIDLinkedAccount.
ProxyDetailsgetProxyDetails()Returns proxy details.
voidgetRemovedAccountList(completion: @escaping UserAccountsRemovedCallback)Returns orphan accounts if any removed.
StringgetWalletPublicKey()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.
StringgetServerPublicKey()Returns server public key of registered tenant.
voidgetSessionResponse(completion: @escaping SessionResponseCallback)Get session response for a particular session URL and sessionID.
BIDTenantgetTenant()Returns root of registered app tenant object.
(TOTP, ErrorResponse)getTOTP()Returns time based OTP value.
voidgetVCsFrom(downloadURL url: String, completion: @escaping VCsCallback)Returns VC data from download URL
voidgetVP(_ dictVCObj: [String: Any], completion: @escaping VPCallback)Returns VP object based on VC data }
StringgetVersion()Returns BlockID SDK version.
voidinitiateTempWallet(completion: @escaping BIDWalletCreationCallback)Initializes and creates temporary application wallet. The wallet contains DID, 12 Mnemonic Phrases, Public Key, and Private Key.
BoolisBiometricEnrollmentUpdated()Checks if the biometrics has been updated after the enrollement.
BoolisDeviceAuthRegistered()Checks and indicates if user has setup biometric option for login purpose.
BoolisLiveIDRegistered()Checks and indicates if user has registered Live ID.
BoolisPinRegistered()Checks and indicates if user has setup (registered) login Pin.
BoolisReady()Checks and indicates if the SDK is ready for use. BlockIDSDK must be ready before using any functions of SDK.
BoolisRestoreModeOn()Checks and indicates id the restore mode is set to true.
BoolisRestoreWalletEnabled(forTenant dns:String, completion: @escaping (Bool)) -> ()Returns true/false if Wallet Restoration is enabled or not.
voidissueJWTOnPasskeyAuthentication(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)Issue JWT using passkey Authentication.
voidpollDocumentSession(sessionId: String, dvcId: String? = nil, completion: @escaping PollSessionCallback)Poll Document Scan Session to get scanned document result.
BoolisTrustedSessionSources(sessionUrl: String, callback: @escaping (Bool) -> Void)Checks and indicates if the given session URL is trusted by BlockID SDK.
voidregisterDocument(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.
voidregisterDocument(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.
voidregisterDocument(obj: [String: Any], sigToken: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping UserAPICallback)Store (add) the given document data.
voidregisterDocument(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.
voidregisterPasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)Registers passkey
voidregisterPasskeyWithAccountLinking(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)Registers passkey with account linking.
voidregisterTenant(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.
voidresetPassword(userId: String, password: String, account: BIDAccount?, origin: BIDOrigin, completion: @escaping UserAPICallback)Resets user password.
voidresetRestorationData()Resets all restoration data.
voidresetSDK(licenseKey: String, rootTenant: BIDTenant, reason: String) -> VoidPurges the SDK wallet and all data stored/owned by the SDK.
voidrestoreUserDataFromWallet(completion: @escaping UserAPICallback)Performs user data restoration from application's wallet.
voidrestoreWalletWithLiveID(controller: UIViewController, rootTenantDNS: String, communityName: String, dvcID: String? = nil, completion: @escaping RestoreWalletWithLiveIDCallback)Restore the wallet using LiveID.
voidsetCurrentUserAccount(account: BIDLinkedAccount)Sets an user's linked account as currently selected account.
voidsetDvcID(dvcID: String)Sets application's dvcID (Document Verification Connector Identifier).
voidsetLicenseKey(key: String)Sets application's license key.
voidsetLinkedAccountsJSON(accountsJSON: String)Set Accounts JSON in the SDK's local storage.
voidsetLiveID(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.
voidsetProxy(host: String, port: Int, userName: String, password: String, isHTPPOnly: Bool)Add proxy to all the outbound API calls used within the SDK.
voidsetRestoreMode()Sets user's account restore mode to true.
voidsetPin(pin: String, proofedBy: String, completion: @escaping UserAPICallback)Registers Pin for login purpose.
voidremovePin(pin: String, completion: @escaping UserAPICallback)Remove (delete) the existing Pin.
voidunLinkAccount(bidLinkedAccount: BIDLinkedAccount, deviceToken: String? = nil, completion: @escaping UserAPICallback)Unlink the existing user account.
voidunregisterDocument(dictDoc: [String: Any], completion: @escaping UserAPICallback)Remove (delete) the existing document.
voidupdateAccountInfo(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
voidupdateAccounts(accounts: [BIDLinkedAccount])This function updates the account list stored in SDK local storage.
voidverifyDocument(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.
voidverifyFaceWithLiveness(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.
voidverifyLiveID(image: UIImage, sigToken: String? = nil, livenessResult: String?, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping LiveIDCallback)Verify Live ID.
BoolverifyPin(pin: String)Returns if the given is verified.
voidverifyUserAccount(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
userIdStringUserID of user's account.
originBIDOriginUser account origin details.
accountBIDAccountAn object of BIDAccount.
callbackUserAPICallbackThe block to execute after the response is received.

authenticatePasskey​

public func authenticatePasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)

  • Authenticate using passkey.
ParameterDescription
controllerUIViewController: Current controller
passkeyRequestPasskeyRequest: The passkey request object containing BIDTenant, userName, displayName
completionPasskeyCallback: 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
sessionIdString: Session for authentication.
credsString: Credential of user's account.
dictScopesDictionary: Authentication data.
latDouble: Latitude of user's location.
lonDouble: Longitude of user's location.
originBIDOrigin: Origin details of user.
userIdString: UserID of user's account.
authFactorString: Performed authentication using which authentication type.
completionAuthenticateUserCallback: 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
sessionIdString: Session for authentication.
sessionUrlString: Complete session URL containing sessionId.
credsString: Credential of user's account.
dictScopesDictionary: Authentication data.
latDouble: Latitude of user's location.
lonDouble: Longitude of user's location.
originBIDOrigin: Origin details of user.
userIdString: UserID of user's account.
authFactorString: Performed authentication using which authentication type.
completionAuthenticateUserCallback: 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
sessionIdString: Session for authentication.
credsString: Credential of user's account.
scopesString: Scopes defined for authentication
latDouble: Latitude of user's location.
lonDouble: Longitude of user's location.
originBIDOrigin: Origin details of user.
userIdString: UserID of user's account.
metaData[String: Any]: Metadata for sign nonce payload
extraData[String: Any]:Dictionary object
authFactorString: Performed authentication using which authentication type
completionAuthenticateUserCallback: 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
controllerUIViewController: Current UIViewController object
sessionIdString: Session for authentication.
sessionUrlString: Complete session URL containing sessionId.
credsString: Credential of user's account.
scopesString: Scopes defined for authentication
latDouble: Latitude of user's location.
lonDouble: Longitude of user's location.
originBIDOrigin: Origin details of user.
userIdString: UserID of user's account.
metaData[String: Any]:Dictionary object to FIDO sign in
extraData[String: Any]:Dictionary object
authFactorString: Performed authentication using which authentication type
isRejectedBool: 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.
completionAuthenticateUserCallback: 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
codeString: Access code to be validated.
originBIDOrigin: Tenant tag.
completionAccessCodeValidationAPICallback: 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
docTypeDocumentScannerType: Type of document
dvcIdString: (Optional) Document Verification Connector Identifier
uidString: (Optional) UID (Unique ID by using it you can filter in AdminX→Verifications).
completionDocumentSessionCallback: 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
strStringData to decrypt.
senderKeyStringPublic 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
inputDataStringData to encrypt.
senderKeyStringPublic 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.
completionFetchDocumentsCallback: 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)
metadataOnlybool

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
tenantDNSBIDTenant: Tenant Object.
keyPathString: key path (ex. applications.mobile)
completionFetchConfigCallback: 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
tenantDNSString: Tenant DNS.
keyPathString: key path
completionFetchConfigCallback: 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
accountsBidLinkedAccount: List of BIDLinkedAccount objects.
completionOTPSeedUpdatedCallback: 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
completionEmptyOTPSeedsForAccountsCallback: 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
accountBIDLinkedAccount: object of BIDLinkedAccount.
completionOTPSeedUpdatedCallback: 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
tenantBIDTenant: BIDTenant Object
userNameString: User Name
completionFetchUserResponseCallBack: 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
tenantBIDTenantTenant details
completionMessageGatewaysCallbackThe 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
accountBIDLinkedAccount: Linked user's account
completionPasswordPolicyCallback: 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
completionUserAccountsRemovedCallback: 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
scopesString: Comma separated scopes.
credsString: User's credentials.
originBIDOrigin: Origin details of user.
userIdString: UserID of user account.
completionDictionary, 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
completionSessionResponseCallbackThe 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
downloadURLString: Download URL.
completionVCsCallback: 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
vcDatadictVCObj: VC Data for which VP has to be created
completionVPCallback: 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
controllerUIViewController: Current controller
passkeyRequestPasskeyRequest: The passkey request object containing BIDTenant, userName
completionPasskeyCallback: 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
sessionUrlStringSession 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
sessionIdString: Session ID for which polling has to be done.
dvcIdString: Document Verification Connector Identifier.
completionPollSessionCallback: 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
objDictionaryDocument data to be stored.
liveIdProofedByStringThe entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid".
docSignTokenStringSignature token of the document to verify if the document data is modified or not.
faceImageUIImageLive ID image to be stored.
liveIDSignTokenStringSignature token of Live ID to verify if the Live ID is modified or not.
mobileSessionIdString(Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString(Optional) Unique Document ID that can be used for event tracking or validation purposes.
completionUserAPICallbackThe 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
objDictionaryDocument data to be stored.
storeArtifactsBoolFlag to indicate if the document must be stored in local storage.
syncArtifactsBoolFlag to indicate if the document must be synced with IPFS on the BlockID platform.
liveIdProofedByStringThe entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid".
docSignTokenStringSignature token of the document to verify if the document data is modified or not.
faceImageUIImageLive ID image to be stored.
liveIDSignTokenStringSignature token of Live ID to verify if the Live ID is modified or not.
mobileSessionIdString(Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString(Optional) Unique Document ID that can be used for event tracking or validation purposes.
completionUserAPICallbackThe 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
objDictionaryDocument data to be stored.
sigTokenStringSignature token of the document to verify if the document data is modified or not.
mobileSessionIdString(Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString(Optional) Unique Document ID that can be used for event tracking or validation purposes.
completionUserAPICallbackThe 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
objDictionaryDocument data to be stored.
storeArtifactsBoolFlag to indicate if the document must be stored in local storage.
syncArtifactsBoolFlag to indicate if the document must be synced with IPFS on the BlockID platform.
sigTokenStringSignature token of the document to verify if the document data is modified or not.
mobileSessionIdString(Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString(Optional) Unique Document ID that can be used for event tracking or validation purposes.
completionUserAPICallbackThe block to execute after the response is received.

registerPasskey​

public func registerPasskey(controller: UIViewController, passkeyRequest: PasskeyRequest, completion: @escaping PasskeyCallback)

  • Register passkey.
Parameter
controllerUIViewController: Current controller
passkeyRequestPasskeyRequest: The passkey request object containing BIDTenant, userName, displayName
completionPasskeyCallback: 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
controllerUIViewController: Current controller
passkeyRequestPasskeyRequest: The passkey request object containing BIDTenant, userName, deviceName
completionPasskeyCallback: 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
tenantBIDTenantTenant details.
callbackBIDTenantRegisterationCallbackThe 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
userIDStringUserid of user's account.
passwordStringCurrent password of user's account.
accountBIDAccountUser's account for which password reset is required.
originBIDOriginOrigin details of user's account.
completionUserAPICallbackThe 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
licenseKeyString application's license key.
rootTenantBIDTenant: Tenant object sent by application
reasonString: 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
accountRestoreListenerUserAPICallbackThe 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
controllerUIViewController: Current controller
rootTenantDNSString: Root tenant DNS
communityNameString: Root tenant community name
dvcIDString: Document Verification Connector Identifier (optional)
completionRestoreWalletWithLiveIDCallback: 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
accountBIDLinkedAccount: User's linked account.

setDvcID​

public func setDvcID(dvcID: String)

  • Sets application's dvcID (Document Verification Connector Identifier).
Parameters
dvcIdStringApplication's dvcID (Document Verification Connector Identifier).

setLicenseKey​

public func setLicenseKey(key: String)

  • Sets application's license key.
Parameters
keyStringapplication license key.

setLinkedAccountsJSON​

public func setLinkedAccountsJSON(accountsJSON: String)

Set Accounts JSON in the SDK's local storage.

Parameter
accountsJSONString: 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
liveIdImageUIImageLive ID (Selfie) image.
liveIdProofedByStringThe entity responsible for proofing the Live ID (selfie). For the BlockID Live ID (selfie) scanner, the default value is "blockid".
sigTokenStringSignature token to verify if the Live ID (selfie) data is modified or not.
livenessResultStringJSON String result data of Liveness check.
mobileSessionIdString (optional)Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString(optional)Unique Document ID that can be used for event tracking or validation purposes.
completionLiveIDCallbackThe 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
hostStringThe hostname associated with the HTTP proxy.
portIntThe port number associated with the HTTP proxy.
userNameStringThe username to be used with the proxy.
passwordStringThe password to be used with the proxy.
isHTPPOnlyBoolIndicates 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
pinString: Pin to enroll (register)
proofedByString: This identifies the entity responsible for proofing. The default value is “blockid”
completionUserAPICallback: The block to execute after the response is received.

removePin​

public func removePin(pin: String, completion: @escaping UserAPICallback)

  • Removes (delete) the existing pin.
Parameter
pinString: Pin to be removed.
completionUserAPICallback: 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
bidLinkedAccountBIDLinkedAccountCurrently linked user account.
deviceTokenStringPushID (push token) of device.
completionUserAPICallbackThe block to execute after the response is received.

unregisterDocument​

public func unregisterDocument(dictDoc: [String: Any], completion: @escaping UserAPICallback)

  • Remove (delete) the existing document.
Parameters
dictDocDictionaryDocument to be removed.
completionUserAPICallbackThe 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
accountBIDLinkedAccount: Account details which used to update unique origin.
pushIDString: 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
completionUpdateAccInfoCallback: 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
dvcIDStringDocument Verification Connector Identifier.
dicDictionaryDictionary of document data.
verificationsString[]List of verification.
mobileSessionIdString (optional)Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString (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
imageUIImageBitmap to compare with enrolled Live ID..
mobileSessionIdString(Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString (optional)Unique Document ID that can be used for event tracking or validation purposes.
completionLiveIDCallbackThe 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
imageUIImageBitmap to compare with enrolled Live ID (selfie).
sigTokenStringSignature token of Live ID
livenessResultStringJSON String result data of Liveness check
mobileSessionIdString (optional)Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString (optional)Unique Document ID that can be used for event tracking or validation purposes.
completionLiveIDCallbackThe 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
userIDString: UserID of user's account.
passwordString: Password of user's account.
originBIDOrigin: Origin details.
deviceTokenString: Push token of user's device. Use for sending push notifications.
latDouble: Longitude of user's location.
lonDouble: Latitude of user's location.
completionUserAPICallback: The block to execute after the response is received.

verifyPin​

public func verifyPin(pin: String) -> Bool

  • Returns if the given is verified.
Parameters
pinStringCurrent Pin for verification.

Typealias​

Parameters
AccessCodeValidationAPICallback(Bool, ErrorResponse, AccessCodeValidationResponseDecryptedData) -> VoidIndicates when the access code validation response is received.
AuthenticateUserCallback(Bool, String, ErrorResponse) -> VoidIndicates when user authentication response is received.
BIDTenantRegisterationCallback(Bool, ErrorResponse, BIDTenant) -> VoidIndicates when the tenant registration is completed.
BIDWalletCreationCallback(Bool, ErrorResponse) -> VoidIndicates when the wallet creation is completed.
OTPSeedUpdatedCallback(Bool, [OTPSeedUpdatedAccountResult] , OTPSeedUpdateAction) -> VoidIndicates when the user's account OTP seed is updated or failed.
EmptyOTPSeedsForAccountsCallback(Bool, ErrorResponse) -> VoidIndicates when the OTP Seeds are Emptied.
FetchUserResponseCallBack(Bool, String, ErrorResponse) -> VoidIndicates when the session response is received.
DocumentSessionCallback(_ status: Bool, _ error: ErrorResponse?,_ response: BIDDocumentSessionResponse?) -> VoidIndicates when the document session is created.
FetchDocumentsCallback(_ status: Bool, _ responseDict: [String: Any]?, _ error: ErrorResponse?) -> VoidCallback that returns documents dictionary.
FetchConfigCallback(_ status: Bool, _ error: ErrorResponse?, _ response: String?) -> VoidCallback 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?) -> VoidIndicates when the KYC operation is completed.
LiveIDCallback(Bool, ErrorResponse) -> VoidIndicates when the Live ID scanning response is received.
MessageGatewaysCallback(_ status: Bool, _ object: [MessageGateway]?, _ error: ErrorResponse?) -> VoidIndicates 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?) -> VoidIndicates when the session polling is completed.
PasskeyCallback(_ status: Bool, _ response: PasskeyResponse?, _ error: ErrorResponse?) -> VoidThe callback interface to handle the result of the passkey operation.
RestoreWalletWithLiveIDCallback(_ status: Bool, _ error: ErrorResponse?) -> VoidIndicates when the restore wallet using live id verification is completed.
SessionResponseCallback(Bool, String, ErrorResponse) -> VoidIndicates when the session response is received.
UpdateAccInfoCallback(_ status: Bool, _ error: ErrorResponse?) -> VoidCallback that gives status after the request is executed.
UserAccountsRemovedCallback(_ status: Bool, _ response: [BIDLinkedAccount]?, _ error: ErrorResponse?) -> VoidIndicates when User Account Remove call completed and returns the remove orphan account list, status and error.
UserAPICallback(Bool, ErrorResponse) -> VoidIndicates 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.