VC Verifier Library is a comprehensive Java/Kotlin library designed to enable the validation and verification of Verifiable Credentials (VCs), a crucial component in modern decentralized identity systems. This library provides a robust mechanism for verifying the authenticity and integrity of VCs, ensuring that the claims made within the credential are both valid and trustworthy.
- VC Validation: The library validates the structure, signatures, and expiration of Verifiable Credentials to ensure they conform to the W3C VC standards.
- Cryptographic Signature Verification: Supports the verification of cryptographic signatures using public keys, including EdDSA, RSA, and other supported algorithms, ensuring the integrity of the credential.
- Compatibility with Various Data Models: It supports multiple VC data models (e.g., VC 1.1, VC 2.0), ensuring compatibility across various decentralized identity systems.
- ldp_vc
- mso_mdoc
- PS256
- RS256
- EdDSA (Ed25519)
- RsaSignature2018
- Ed25519Signature2018
- Ed25519Signature2020
io.mosip.vercred.vcverifier
- constants
- credentialverifier
types
validator
verifier
- data
- exception
- signature
impl
- utils
- CredentialVerifier.kt
- constants - All Validator and Verifier constants are declared in this package.
- credentialverifier - CredentialFactory for different credential formats are declared in this package. It also consists of classes for different credential formats.
- data - It has data classes for Validation Status and Verification Result.
- exception - Custom exceptions are defined in this package.
- signature - Interface and Implementations for multiple Signature Verification are available in this package.
- utils - It helper classes and methods that provide reusable and general-purpose functionalities across the project.
- CredentialVerifier.kt - The
CredentialVerifier.kt
file serves as the main entry point to the VC Verifier Library. This class provides the primary interface for interacting with the library and encapsulates all the core functionalities related to validating and verifying Verifiable Credentials (VCs).
<dependency>
<groupId>io.mosip</groupId>
<artifactId>vcverifier-jar</artifactId>
<version>{{version-number}}</version>
</dependency>
To integrate vc-verifier library into a Maven project , include below additional dependencies that are not managed via the pom.xml
file of vc-verifier library.
<dependency>
<groupId>com.android.identity</groupId>
<artifactId>identity-credential</artifactId>
<version>20231002</version>
</dependency>
<dependency>
<groupId>info.weboftrust</groupId>
<artifactId>ld-signatures-java</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>decentralized-identity</groupId>
<artifactId>jsonld-common-java</artifactId>
<version>1.8.0</version>
</dependency>
To integrate vc-verifier library into a Gradle project , add below line in module level build.gradle
.
dependencies {
implementation("io.mosip:vc-verifier:{{version-number}}")
}
To avoid Duplicate classes error while building the application, include the below exclusion strategy in the build.gradle file.
configurations.all {
resolutionStrategy {
exclude(module = "bcprov-jdk15to18")
exclude(module = "bcutil-jdk18on")
exclude(module = "bcprov-jdk15on")
exclude(module = "bcutil-jdk15on")
exclude(module = "titanium-json-ld")
}
}
Note: version-number
should be replaced with the actual version of the library from Maven Central.