https://github.com/windowsnt/ades
An Implementation of CAdES, XAdES, PAdES and ASiC for Windows in C++
https://github.com/windowsnt/ades
asic cades eidas etsi mime pades pdf xades xml
Last synced: 2 months ago
JSON representation
An Implementation of CAdES, XAdES, PAdES and ASiC for Windows in C++
- Host: GitHub
- URL: https://github.com/windowsnt/ades
- Owner: WindowsNT
- License: mit
- Created: 2018-08-20T14:48:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-18T15:45:22.000Z (about 5 years ago)
- Last Synced: 2025-03-24T13:36:08.998Z (3 months ago)
- Topics: asic, cades, eidas, etsi, mime, pades, pdf, xades, xml
- Language: C++
- Homepage:
- Size: 1.3 MB
- Stars: 34
- Watchers: 6
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# AdES
A C++ library for Windows to create CAdES (B,T,C,X,XL), XAdES (B-T,C,X,XL) and PAdES (B-B,B-T,B-XL) messages. Also supports ASiC-S and ASiC-E with both CAdES and XAdES. 100% ETSI Compliant.
Article at CodeProject: https://www.codeproject.com/Articles/1256991/AdES-An-implementation-of-CAdES-for-Windows-in-Cpl## CAdES
Quick guide:```C++
HRESULT Sign(LEVEL lev,const char* data,DWORD sz,const std::vector& Certificates, SIGNPARAMETERS& Params,std::vector& Signature);
HRESULT Verify(const char* data, DWORD sz, LEVEL& lev,const char* omsg = 0,DWORD len = 0,std::vector* msg = 0,std::vector* Certs = 0,VERIFYRESULTS* vr = 0);
```Where
* lev, enumeration from LEVEL: CMS,B,T,C,X or XL
* data/sz, the data to sign
* Certificates, a list of certificates to use for signing. Each CERT contains the certificate, CRLs, and more validation certificates
* Params, additional parameters, including timestamp server, policy, commitment type, attach method etc.In Verify()
* data/sz, the signature to verify
* lev, gets the detected level
* omsg/len, the original data if the signature was detached
* msg/certs/results, returned message, certificates used, and other data (policy, commitment type etc)## XAdES
Quick guide:```C++
struct FILEREF
{
const char* data = 0; // pointer to data
DWORD sz = 0; // size, or 0 if null terminated XML
const char* ref = 0;
std::string mime = "application/octet-stream";
};
HRESULT XMLSign(LEVEL lev, std::vector& data,const std::vector& Certificates,SIGNPARAMETERS& Params, std::vector& Signature);// Currently XMLDSIG only
HRESULT XMLVerify(const char* xmldata, LEVEL& lev, ATTACHTYPE& att, const char* omsg, DWORD len, bool WasDetachedCanonicalized,std::vector * Certs, VERIFYRESULTS * vr);
```## PAdES
Quick guide:```C++
HRESULT PDFSign(LEVEL lev,const char* data,DWORD sz,const std::vector& Certificates, SIGNPARAMETERS& Params,std::vector& Signature);
```## ASiC
Quick guide:```C++
HRESULT ASiC(ALEVEL alev,ATYPE typ, LEVEL lev,std::vector& data,std::vector& Certificates, SIGNPARAMETERS& Params, std::vector& fndata);
```## EXE
Quick guide:```C++
HRESULT PESign(LEVEL lev,const char* data,DWORD sz,const std::vector& Certificates, SIGNPARAMETERS& Params,std::vector& Signature);
```