1. Introduction
The Virifi Digital Signature SDK provides developers and system integrators with a secure, standards-compliant toolkit for implementing digital signing, certificate management, and document validation. This SDK ensures seamless interoperability with the Central Bank of Jordan (CBJ) PKI framework, while adhering to ETSI eIDAS and NIST FIPS standards.
The SDK modules are available for:
Web browsers (JavaScript)
Android native applications
iOS native applications
2. Web SDK Installation
2.1 System Requirements
Node.js v18 to v20 (LTS)
npm (Node Package Manager)
HTTPS-enabled environment
Mutual TLS client certificate (issued by CBJ)
Compatible browsers: Chrome, Firefox, Safari, Edge
2.2 Installation Methods
Option A β Using NPM (Recommended)
Use credentials username: virifi password: Virifiadmin@2025
npm login
npm install @virifi/digisig-sdk
Option B β GitHub-Based Integration
"dependencies": {
"virifi-signature-sdk": "git+https://github.com/virifi/virifi-signature-sdk.git"
}
2.3 SDK Initialization
const sdk = new VirifiSDK({
baseUrl: 'https://cbj-sign.virifi.co/api',
clientCert: 'path/to/certificate.pem',
token: 'your-jwt-token' // Optional
});
2.4 Core Functional Operations
Upload a Document for Signing:
const sdk = new VirifiSDK({
baseUrl: 'https://cbj-sign.virifi.co/api',
clientCert: 'path/to/certificate.pem',
token: 'your-jwt-token' // Optional
});Request Signature:
await sdk.requestSignature(documentId, {
signerId: 'user-xyz',
reason: 'Document Approval',
signatureType: 'XAdES' // or 'PAdES', 'CAdES', 'JAdES'
});Validate a Signed Document:
await sdk.validateSignature(fileBuffer, fileType, apiKey);
Download a Signed Document:
await sdk.downloadFile(fileId, apiKey);
View Signature History:
await sdk.history(apiKey);
3. Android SDK Installation
3.1 Prerequisites
Android Studio Electric Eel or newer
Android SDK version 24+
Android Dependency (aar)
Secure hardware-backed Keystore (device-level)
Internet access
3.2 Installation Steps
3.2.1 Method 1: Direct .aar Download
Download the .aar file available at the bottom of this article
2. Place the downloaded .aar file inside your project's libs/ directory.
3. Add the following to your build.gradle:
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.google.code.gson:gson:2.10'
implementation(files("libs/androidjojolibrary-release.aar"))
3.2.2 Method 2: Clone from GitHub
1. Clone the SDK repository:
β https://github.com/Virifi-Technologies-LTD/cbj-android-sdk
2. Open Terminal in Android Studio and run:
./gradlew assembleRelease
If you get a Permission denied error, run:
chmod +x ./gradlew
./gradlew build
./gradlew assembleRelease
3. After successful build, locate the .aar file at:
/JojoAndroidSDK/androidjojolibrary/build/outputs/
4. Add it to your project's libs/ folder and include the same dependencies as
shown above.
SDK Setup Instructions
1. Include Core SDK FileAdd FileUploadServiceProtocol.kt to your project, ideally inside a namespacelike com.yourapp.sdk.
2. Add PermissionsIn your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
3. Initialize the SDK Call once before using the SDK:
FileUploadServiceProtocol.initialize(applicationContext)
Add Dependency in build.gradle:
implementation 'co.virifi.digisign:sdk:1.2.0'
Initialize SDK in Application Class:
FileUploadServiceProtocol.initialize(applicationContext)
Perform Signature Operations:
FileUploadServiceProtocol.uploadDocuments(
file = yourFile,
token = "Bearer <your_api_key>",
context = applicationContext,
email_list = arrayListOf("[email protected]", "[email protected]"),
radio_type = "sequential" // or "parallel"
)
Perform Verification Operations:
FileUploadServiceProtocol.verifyDocuments(
file = yourFile,
token = "Bearer <your_api_key>",
context = applicationContext
)
4. iOS SDK Installation
4.1 Prerequisites
Xcode 14+
iOS 13.0+ deployment target
Access to Secure Enclave recommended
4.2 Installation Methods
1. Add the Package: Open Xcode and navigate to File > Add Packages.
Enter the GitHub URL: https://github.com/Virifi-Technologies-LTD/cbj-ios-sdk to add the
CBJFramework to your project.
2. Import the Framework: In your Swift files, import CBJFramework and access the
service using:
import CBJFrameworklet
cbjService = CBJFramework.getFrameworkServices()
3. Use the Framework: You can now call the available methods to upload, verify,
download, and sign documents.
4. Accessing the Service
let cbjService = CBJFramework.getFrameworkServices()
This returns a singleton instance that conforms to CBJServiceProtocol.
4.3 SDK Initialization
let cbjService = CBJFramework.getFrameworkServices()
Execute Signing Operation:
func uploadDocument(apiKey: String, fileURL: URL, signers: [String], signingType: String, completion: @escaping (Bool, FileUploadResponse?) -> Void)
Execute Verification Operation:
func verifyDocument(apiKey: String, fileURL: URL, completion: @escaping (Bool, FileUploadResponse?) -> Void)
5. Security and Compliance Features
End-to-end TLS (v1.2 or higher)
Mutual TLS (mTLS) using CBJ-issued certificates
Certificate-based identity validation
Adherence to ETSI eIDAS standards: XAdES, PAdES, CAdES, JAdES
Post-quantum cryptography (FIPS 204 ML-DSA) support
Audit logging and traceability for all operations
