Download the PHP package inovanti-bank/rsa-validator without Composer
On this page you can find all versions of the php package inovanti-bank/rsa-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inovanti-bank/rsa-validator
More information about inovanti-bank/rsa-validator
Files in inovanti-bank/rsa-validator
Package rsa-validator
Short Description Package for validation and decryption using RSA public keys (Private Key and Public Key)
License MIT
Informations about the package rsa-validator
RSA Validator
A Laravel ^11 package for validating and decrypting data using RSA public and private keys. This package is designed to simplify secure communication with APIs using client-specific keys.
Features
- Decrypts and validates Base64-encoded data using public RSA keys.
- Supports configuration of key storage in the database.
- Automatically loads migrations and configuration for Laravel projects.
- Fully compatible with Laravel ^11 and PHP ^8.0+.
Installation
To install the package via Composer, run:
Configuration
- After installing the package, the configuration and migrations are automatically loaded.
-
If you need to customize the configuration file, you can publish it manually using:
- This will publish the config/rsa-validator.php file. The default configuration is as follows:
How to Use
Storing Public Keys
Ensure you have a table (rsa_validator by default) to store the public keys. Use the following schema to insert a public key:
Decrypting Data
To decrypt and validate incoming data:
Exception Handling
The following exceptions may be thrown:
- PublicKeyNotFoundException: Public key for the specified client is not found.
- DecryptionFailedException: The decryption process faile
Testing
It is highly recommended that you create some tests in your Laravel project to ensure that it works, see some test examples:
Contributing
If you want to contribute to this package:
- Fork the repository.
- Create a new branch.
- Submit a pull request.
License
This package is open-source software licensed under the MIT license.