Skip to main content

BlockIDSDK

public class BlockIDSDK extends NSObject


This class is the entry point of BlockID SDK. This class is 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
voidaddNativeAccount(method: String!, userId: String, password: String, origin: BIDOrigin, deviceToken: String? = nil, lon: Double, lat: Double, completion: @escaping UserAPICallback)Add user account based on given userid and password.
voidaddPreLinkedUser(userId: String, scep_hash: String, scep_privatekey: String, origin: BIDOrigin, account: BIDAccount?, completion: @escaping UserAPICallback)Provides an option to add already linked user.
voidauthenticateFIDO2Key(controller: UIViewController, userName: String, tenantDNS: String, communityName: String, type: FIDO2KeyType, fileName: String? = nil, completion: @escaping FIDO2Callback)Provides the capability to authenticate FIDO2 security key
voidauthenticateFIDO2Key(type: FIDO2KeyType, controller: UIViewController? = nil, sessionId: String?, sessionURL: String creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, completion: @escaping AuthenticateUserCallback)Provides the capability to authenticate FIDO2 security key using UWL 2.0
voidauthenticateFIDO2Key(userName: String, tenantDNS: String, communityName: String, completion: @escaping Fido2Callback)Provides the capability to authenticate FIDO2 security key.
voidauthenticateUser(sessionId: String?, creds: String, dictScopes: [String: Any], lat: Double, lon: Double, origin: BIDOrigin, userId: 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, completion: @escaping AuthenticateUserCallback)Authenticate user with preset data (UWL2.0).
voidauthenticateUser(sessionId: String?, creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, extraData: [String: Any]? = 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, 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.
voidchangeFido2PIN(oldPin: String, newPin: String, completion: @escaping FIDO2PINCallback)Change FIDO2 PIN.
BoolcheckDeviceTrust()Checks and indicates if the device is trusted.
voidcommitApplicationWallet()Commits the application wallet if tenant registration is successful.
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.
voidfetchGlobalConfig(_ tenant: BIDTenant, completion: @escaping GlobalConfigCallback)Fetch global configuration to find restorable accounts.
voidsetPin(pin: String, proofedBy: String, completion: @escaping UserAPICallback)Register Pin for login purpose.
BiometricAssetsgetBiometricAssetEnrollments()Returns registered biometric assets (Pin, Face ID / Touch ID, Live ID)
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.
(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
StringgetOfflineAuthPayload(bidLinkedAccount: BIDLinkedAccount)Returns offline authentication payload.
ProxyDetailsgetProxyDetails()Returns proxy details.
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.
(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.
BoolisAddressVerificationDone()Checks if the address is verified. As of now, it always returns false.
BoolisDeviceAuthRegistered()Checks and indicates if user has setup biometric option for login purpose.
BoolisDLEnrolled()Checks and indicates if user has registered Drivers License.
BoolisLiveIDRegistered()Checks and indicates if user has registered Live ID.
BoolisNationalIdEnrolled()Checks and indicates if user has registered National ID.
BoolisPassportEnrolled()Checks and indicates if user has registered Passport.
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.
BoolisSSNEnrolled()Checks and indicates if the SSN (Social Security Number) is enrolled.
BoolisTrustedSessionSources(sessionUrl: String)Checks and indicates if the given session URL is trusted by BlockID SDK.
voidregisteredocument(obj: [String: Any], liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, completion: @escaping UserAPICallback)Store (add) the given document data along with Live ID.
voidregisteredocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: 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.
voidregisteredocument(obj: [String: Any], sigToken: String? = nil, completion: @escaping UserAPICallback)Store (add) the given document data.
voidregisteredocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, signToken: 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.
voidregisterFIDO2Key(controller: UIViewController, linkedAccount: BIDLinkedAccount?, type: FIDO2KeyType, completion: @escaping FIDO2Callback)Provides the capability to register FIDO2 security key with BIDLinkedAccount
voidregisterFIDO2Key(controller: UIViewController, userName: String, tenantDNS: String, communityName: String, type: FIDO2KeyType, pin: String? = nil, setPin: Bool = false, completion: @escaping FIDO2Callback)Provides the capability to register FIDO2 security key.
voidregisterFIDO2Key(userName: String, tenantDNS: String, communityName: String, fileName: String? = nil, completion: @escaping FIDO2Callback)Provides the capability to register web-based FIDO2 security key.
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.
voidresetFido2PIN(completion: @escaping FIDO2PINCallback)Reset FIDO2 security key.
voidresetPassword(userId: String, password: String, account: BIDAccount?, origin: BIDOrigin, completion: @escaping UserAPICallback)Resets user password.
voidresetRestorationData()Resets all restoration data.
voidresetSDK(licenseKey: 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.
voidsetDvcID(dvcID: String)Sets application's dvcID (Document Verification Connector Identifier).
voidsetFido2PIN(newPin: String, completion: @escaping FIDO2PINCallback)Set FIDO2 PIN.
voidsetLicenseKey(key: String)Sets application's license key.
voidsetLiveID(liveIdImage: UIImage , liveIdProofedBy: String? = nil, sigToken: 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.
voidsetCurrentUserAccount(account: BIDLinkedAccount)Sets an user's linked account as currently selected account.
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.
voidunregisteredocument(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
voidverifyDocument(dvcID: String, dic: [String: Any], verifications: [String], completion: @escaping ((Bool, [String: Any]?, ErrorResponse?) -> Void))Verify document data (that the user has presented) through our partners.
voidverifyLiveID(image: UIImage, sigToken: String? = nil, completion: @escaping LiveIDCallback)Verify Live ID.
BoolverifyPin(pin: String)Returns if the given is verified.

Method Detail​

addNativeAccount​

public func addNativeAccount(method: String!, userId: String, password: String, origin: BIDOrigin, deviceToken: String? = nil, lon: Double, lat: Double, completion: @escaping UserAPICallback)

  • Add user account based on given userid and password.
Parameters
methodStringMethod type to add account.
userIdStringUserID of user's account.
passwordStringPassword of user's account.
originBIDOriginOrigin details.
deviceTokenStringPush token of user's device. Use for sending push notifications.
lonStringLongitude of user's location.
latStringLatitude of user's location.
completionUserAPICallbackThe block to execute after the response is received.

addPreLinkedUser​

public func addPreLinkedUser(userId: String, scep_hash: String, scep_privatekey: String, origin: BIDOrigin, account: BIDAccount?, completion: @escaping UserAPICallback)

  • Provides an option to add already linked users.
Parameters
userIdStringUserID of user's account.
scep_hashStringScep hash value.
scep_privatekeyStringScep private key.
scep_expiryStringScep expiry.
originBIDOriginUser account origin details.
accountBIDAccountAn object of BIDAccount.
callbackUserAPICallbackThe block to execute after the response is received.

authenticateFIDO2Key​

public func authenticateFIDO2Key(controller: UIViewController, userName: String, tenantDNS: String, communityName: String, type: FIDO2KeyType, fileName: String? = nil, completion: @escaping FIDO2Callback)

  • Provides the capability to authenticate FIDO2 security key.
Parameter
controllerUIViewController: The UIViewController object uses to set up user consent UI.
userNameString: The user name which requires authentication.
tenantDNSString: The tenant DNS against which the user is authenticated.
communityNameString: The community name against which the user is authenticated.
communityNameString: The community name against which the user is authenticated.
typeFIDO2KeyType: FIDO2 key type.
completionFIDO2Callback: The block to execute after the response is received.

authenticateFIDO2Key​

public func authenticateFIDO2Key(type: FIDO2KeyType, controller: UIViewController? = nil, sessionId: String?, sessionURL: String creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, completion: @escaping AuthenticateUserCallback)

  • Provides the capability to authenticate FIDO2 security key using UWL 2.0.
Parameter
typeFIDO2KeyType: Current FIDO2 key type
controllerUIViewController: Current UIViewController object
sessionIdString: Session for authentication.
sessionUrlString: Complete session URL containing sessionId.
credsString: Credential of user account.
scopesString: Scopes defined for authentication
latDouble: Latitude of user location.
lonDouble: Longitude of user location.
originBIDOrigin: Origin details of the user.
userIdString: UserID of user account.
metaData[String: Any]: Dictionary object for FIDO2 sign-in
completionAuthenticateUserCallback: The block to execute after the response is received.

authenticateFIDO2Key​

public func authenticateFIDO2Key(userName: String, tenantDNS: String, communityName: String, fileName: String? = nil, completion: @escaping FIDO2Callback)

  • Provides the capability to authenticate web-based FIDO2 security key.
Parameters
userNameString: The user name which requires authentication.
tenantDNSString: The tenant DNS against which the user is authenticated.
communityNameString: The community name against which the user is authenticated.
fileNameString: The HTML file name.
completionFIDO2Callback: 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, 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.
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, 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.
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, extra data: [String: nil]? = 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.
extraData[String: Any]:Dictionary object
completionAuthenticateUserCallback: The block to execute after the response is received.

authenticateUser​

public func authenticateUser(type: FIDO2KeyType, controller: UIViewController? = nil, sessionId: String?, sessionURL: String creds: String, scopes: String, lat: Double, lon: Double, origin: BIDOrigin, userId: String? = nil, metaData: [String: Any]? = nil, completion: @escaping AuthenticateUserCallback)

  • Authenticate user with scope (UWL2.0).
Parameter
typeFIDO2KeyType: Current
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
completionAuthenticateUserCallback: The block to execute after the response is received.

changeFIDO2PIN​

public func changeFido2PIN(oldPin: String, newPin: String, completion: @escaping FIDO2PINCallback)

  • Change FIDO2 PIN
Parameter
oldPINString: oldPiN
newPINString: newPin
completionFIDO2PINCallback: The block to execute after the response is received.

checkDeviceTrust​

public func checkDeviceTrust() -> Bool

  • Checks and indicates if the device is trusted.

commitApplicationWallet​

public func commitApplicationWallet()

  • Commits the application's wallet IFF tenant registration is successful.

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"]
}

fetchGlobalConfig​

public func fetchGlobalConfig(_ tenant: BIDTenant, completion: @escaping GlobalConfigCallback)

  • Fetch global configuration to find restorable accounts.
Parameter
tenantBIDTenant: Object of BIDTenant.
completionGlobalConfigCallback: Callback that returns global configuration.

setPin​

public func setPin(pin: String, proofedBy: String, completion: @escaping UserAPICallback) -> Void

  • Register Pin for login purposes.
Parameters
pinStringPin to enroll (register)
proofedByStringThis identifies the entity responsible for proofing. The default value is "blockid"
completionUserAPICallbackThe block to execute after the response is received.

getBiometricAssetEnrollments​

public func getBiometricAssetEnrollments() -> BiometricAssets?

  • Returns registered biometric assets (Pin, Face ID / Touch ID, Live ID)

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.

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.

getOfflineAuthPayload​

public func getOfflineAuthPayload(bidLinkedAccount: BIDLinkedAccount) -> String?

  • Returns offline authentication payload.
Parameters
bidLinkedAccountBIDLinkedAccountLinked user's account.

getProxyDetails​

public func getProxyDetails() -> ProxyDetails?

  • Returns proxy details.

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.

getTOTP​

public func getTOTP() -> (totp: TOTP?, error: ErrorResponse?)

  • Returns time-based OTP value.

getVCsFrom​


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.

isAddressVerificationDone​

public func isAddressVerificationDone() -> Bool

  • Checks if the address is verified. As of now, it always returns false.

isDeviceAuthRegistered​

public func isDeviceAuthRegistered() -> Bool

  • Checks and indicates if the user has set up a biometric option for login purposes.

isDLEnrolled​

public func isDLEnrolled() -> Bool

  • Checks and indicates if the user has a registered Drivers License.

isLiveIDRegistered​

public func isLiveIDRegistered() -> Bool

  • Checks and indicates if the user has registered Live ID.

isNationalIdEnrolled​

public func isNationalIdEnrolled() -> Bool

  • Checks and indicates if the user has registered National ID.

isPassportEnrolled​

public func isPassportEnrolled() -> Bool

  • Checks and indicates if the user has registered a Passport.

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.

isSSNEnrolled​

public func isSSNEnrolled() -> Bool

  • Checks and indicates if the SSN (Social Security Number) is enrolled.

isTrustedSessionSources​

public func isTrustedSessionSources(sessionUrl: String) -> Bool

  • 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.

registeredocument​

public func registeredocument(obj: [String: Any], liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: String? = nil, completion: @escaping UserAPICallback)

  • Store (add) the given document data along with Live ID.
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 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.
completionUserAPICallbackThe block to execute after the response is received.

registeredocument​

public func registeredocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, liveIdProofedBy: String, docSignToken: String? = nil, faceImage: UIImage, liveIDSignToken: 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.
completionUserAPICallbackThe block to execute after the response is received.

registeredocument​

public func registeredocument(obj: [String: Any], sigToken: String? = nil, completion: @escaping UserAPICallback)

  • Store (add) the given document data.
Parameters
objDictionaryDocument data to be stored.
sigTokenStringSignature token of the document to verify if the document data is modified or not.
completionUserAPICallbackThe block to execute after the response is received.

registeredocument​

public func registeredocument(obj: [String: Any], storeArtifacts: Bool, syncArtifacts: Bool, signToken: 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.
completionUserAPICallbackThe block to execute after the response is received.

registerFIDO2Key​

public func registerFIDO2Key(controller: UIViewController, linkedAccount: BIDLinkedAccount?, type: FIDO2KeyType, completion: @escaping FIDO2Callback)

  • Provides the capability to register FIDO2 security key with BIDLinkedAccount.
Parameter
controllerUIViewController: Current controller.
linkedAccountBIDLinkedAccount: account object to be registered.
typeFIDO2KeyType: Current fido key type.
completionFIDO2Callback: The block to execute after the response is received.

registerFIDO2Key​

public func registerFIDO2Key(controller: UIViewController, userName: String, tenantDNS: String, communityName: String, type: FIDO2KeyType, pin: String? = nil, completion: @escaping FIDO2Callback)

  • Provides the capability to register FIDO2 security key.
Parameter
controllerUIViewController: Current controller.
userNameString: The user name which requires to be registered.
tenantDNSString: The tenant's DNS against which the user is registered.
communityNameString: The community name against which the user is registered.
typeFIDO2KeyType: Current fido key type.
pinString: PIN of the device to be used for authentication.
setPinBool: Set PIN during FIDO2 registration or not
completionFIDO2Callback: The block to execute after the response is received.

registerFIDO2Key​

public func registerFIDO2Key(userName: String, tenantDNS: String, communityName: String, fileName: String? = nil, completion: @escaping FIDO2Callback)

  • Provides the capability to register web based FIDO2 security key.
Parameter
userNameString: The user name which requires to be registered.
tenantDNSString: The tenant's DNS against which the user is registered.
communityNameString: The community name against which the user is registered.
fileNameString: The HTML file name.
completionFIDO2Callback: 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.
Parameters
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) -> Void

  • Purges the SDK wallet and all data stored/owned by the SDK.
Parameters
licenseKeyStringapplication's license key.

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

setDvcID​

public func setDvcID(dvcID: String)

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

setFIDO2PIN​

public func setFido2PIN(newPin: String, completion: @escaping FIDO2PINCallback)

  • Set FIDO2 PIN
Parameter
newPinString: New Pin.
completionFIDO2PINCallback: The block to execute after the response is received.

setLicenseKey​

public func setLicenseKey(key: String)

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

setLiveID​

public func setLiveID(liveIdImage: UIImage , liveIdProofedBy: String? = nil, sigToken: String? = nil, completion: @escaping LiveIDCallback)

  • Register (store) the 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.
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.

setCurrentUserAccount​

public func setCurrentUserAccount(account: BIDLinkedAccount)

  • Sets a user's linked account as the currently selected account.
Parameters
accountBIDLinkedAccountUser's linked account.

removePin​

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

  • Remove (delete) the existing Pin.
Parameters
pinStringPin to be removed.
completionUserAPICallbackThe block to execute after the response is received.

resetFIDO2PIN​

public func resetFido2(completion: @escaping FIDO2PINCallback)

  • Reset FIDO2 Security key
Parameter
completionFIDO2PINCallback: 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 unregistereDocument(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.

validateAccessCode​

public func validateAccessCode(code: String, origin: BIDOrigin, completion: @escaping AccessCodeValidationAPICallback)

  • Check the validity of the access code. Access code validation is required during the access code redemption process.
Parameters
codeStringAccess code to be validated.
originBIDOriginTenant tag.
completionAccessCodeValidationAPICallbackThe 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.

verifyDocument​

public func verifyDocument(dvcID: String, dic: [String: Any], verifications: [String], 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.
completion((Bool, [String: Any]?, ErrorResponse?) -> Void)The block to execute after the response is received.

verifyLiveID​

public func verifyLiveID(image: UIImage, sigToken: String? = nil, completion: @escaping LiveIDCallback)

  • Verify Live ID.
Parameters
imageUIImageBitmap to compare with enrolled Live ID (selfie).
sigTokenStringSignature token of Live ID
completionLiveIDCallbackThe 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.
BIDMigrationCallback(Bool, ErrorResponse) -> VoidIndicates when the migration activity is completed.
BIDTenantRegisterationCallback(Bool, ErrorResponse, BIDTenant) -> VoidIndicates when the tenant registration is completed.
BIDWalletCreationCallback(Bool, ErrorResponse) -> VoidIndicates when the wallet creation is completed.
FetchDocumentsCallback(_ status: Bool, _ responseDict: [String: Any]?, _ error: ErrorResponse?) -> VoidCallback that returns documents dictionary.
FIDO2Callback(_ status: Bool, _ error: ErrorResponse?) -> VoidIndicates when the FIDO2 operation (registration / authentication) is completed.
FIDO2PINCallback(_ status: Bool, _ error: ErrorResponse?) -> VoidIndicates when the FIDO2 operation (set pin/ change pin/ reset FIDO2) is completed.
GlobalConfigCallback(_ status: Bool, _ error: ErrorResponse?, _ response: GlobalConfigResponse?) -> VoidCallback that returns global configuration.
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.
SessionResponseCallback(Bool, SessionResponseData, ErrorResponse) -> VoidIndicates when the session response is received.
UpdateAccInfoCallback(_ status: Bool, _ error: ErrorResponse?) -> VoidCallback that gives status after the request is executed.
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.