https://github.com/sapteamdev/easysign
Signing and Verification library for C#
https://github.com/sapteamdev/easysign
Last synced: 6 months ago
JSON representation
Signing and Verification library for C#
- Host: GitHub
- URL: https://github.com/sapteamdev/easysign
- Owner: SAPTeamDEV
- License: mit
- Created: 2024-10-16T04:27:13.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-13T18:24:40.000Z (9 months ago)
- Last Synced: 2025-07-22T05:59:24.286Z (6 months ago)
- Language: C#
- Size: 5.92 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Easy Sign
[](https://github.com/SAPTeamDEV/EasySign/actions/workflows/main.yml)
[](https://github.com/SAPTeamDEV/EasySign/actions/workflows/codeql.yml)
[](https://www.nuget.org/packages/SAPTeam.EasySign)
[](https://www.nuget.org/packages/SAPTeam.EasySign)
Easy Sign is a simple C# library for signing and verifying files. It supports multiple .NET targets, including .NET Standard 2.1, .NET 6, and .NET 8.
## Features
- Sign files with X.509 certificates.
- Verify file integrity and signatures.
- Store files within the bundle.
- Support for concurrent operations.
- AOT compilation support.
- Logging support.
## Installation
To install Easy Sign, run the following command:
```
dotnet add package SAPTeam.EasySign
```
## Usage
### Creating a Bundle
```
using SAPTeam.EasySign;
// Initialize a new bundle
var bundle = new Bundle("path/to/dir");
// Add files to the bundle
bundle.AddEntry("path/to/dir/file1.txt");
bundle.AddEntry("path/to/dir/file2.txt");
// Sign the bundle
var certificate = new X509Certificate2("path/to/certificate.pfx", "password");
var privateKey = certificate.GetRSAPrivateKey();
bundle.Sign(certificate, privateKey);
// Save the bundle
bundle.Update();
```
### Loading and Verifying a Bundle
```
using SAPTeam.EasySign;
// Load an existing bundle
var bundle = new Bundle("path/to/dir");
bundle.LoadFromFile();
// Get certificate hash
string certificateHash = bundle.Signatures.Entries.First().Key;
// Verify certificate
bool isCertificateValid = bundle.VerifyCertificate(certificateHash);
// Verify signature
bool isSignatureValid = bundle.VerifySignature(certificateHash);
// Verify files integrity
bool isFileValid = bundle.VerifyFile("file1.txt");
bool isFile2Valid = bundle.VerifyFile("file2.txt");
```
## Documentation
A full API Documentation is available at [EasySign Project Site](https://sapteamdev.github.io/EasySign).
## Command Line Interface
Easy Sign also provides a command line interface (CLI) for signing and verifying files. To install the CLI tool, use the following command:
```
dotnet tool install -g SAPTeam.EasySign.Tool
```
For more informations, see the [CLI Readme](https://github.com/SAPTeamDEV/EasySign/blob/master/src/EasySign.Cli/README.md).
## Security Reporting
If you discover any security vulnerabilities, please report them by following our [Security Guidelines](https://github.com/SAPTeamDEV/EasySign/blob/master/SECURITY.md).
## Contributing
We welcome contributions! Please see our [Contributing guide](https://github.com/SAPTeamDEV/EasySign/blob/master/CONTRIBUTING.md) for more information on how to get started.
## License
This project is licensed under the [MIT License](https://github.com/SAPTeamDEV/EasySign/blob/master/LICENSE.md).