It allows to verify all signature schemes supported by the IC, including canister signatures. It also takes over all the DER-key parsing to figure out the signature scheme used. The library should be compatible with all major browsers and node.
Verifying signatures in the front-end is generally unsafe! Malicious users could modify the front-end code and bypass the signature verification. This library is intended for use in demos, prototypes, backends and other situations where the code either cannot be tampered with or the tampering does not pose a security risk.
This library is built from the master branch of the ic repo rather than a proper release of the underlying library. This means that the API may change at any time.
The resulting wasm module is heavy, around 400 kb gzipped. Do not use this library if you are concerned about the size of your bundle.
Still, maybe it is useful for some.
It is also open for external contributions, so feel free to open PRs if you want to improve it.
This is a tool to implement higher-level use-cases. So far, we have used it internally for R&D purposes, i.e. to be able to quickly try out new protocols. For example in the process of validating the challenges as per ICRC-32 draft standard.
We will also release an example project showcasing how to integrate Internet Identity sign-in into a Web 2.0 application, where the underlying library is based on that project.
So it really depends what problem you would like to solve. It might not be applicable in all cases, but if your problem entails checking signatures produced by the IC, then this is definitely a useful tool.
But why is it necessary to check the login process on a Web2 application and how is it different from a Web3 application?
This is just a different use-case. It is aimed at existing Web2 projects that want to start offering their service to Web3 users by allowing sign-in with II.
It is different from a Web3 application (specifically one built on the IC) because in Web3 the platform will validate the caller / signature whereas in Web2 it is the responsibility of the application.
You don’t need to use this library if you do not have any use for it.