@gaia-x/gx-trusted-list-serializer
v1.0.1
Published
A lightweight ETSI 119 612 serializer for creating Gaia-X Trust Anchors list
Downloads
74
Readme
Gaia-X Trusted List Serializer
🪶 A lightweight ETSI 119 612 serializer for creating Gaia-X Trust Anchors list, by Gaia-X AISBL
Requirements
This library requires Node version 18 and is compatible with Typescript projects.
Getting Started
First, install the package:
npm install @gaia-x/gx-trusted-list-serializer
Features
The library supports serialization of trusted service lists as defined in ETSI 119 612, including features such as:
- XML serialization with custom namespaces
- Integration with xadesjs for XAdES signing of serialized data
- Extensible with additional service information
Usage
Here is a quick start example to serialize a list of trust service providers:
import { TrustedListSerializer, TrustServiceProvider } from '@gaia-x/gx-trusted-list-serializer';
const providers: TrustServiceProvider[] = [{
name: 'Service Provider One',
certificate: 'CERTIFICATE_PEM_STRING',
uri: 'http://example.com',
list: { uri: 'http://example.com' }
}];
const serializer = new TrustedListSerializer(
new XadesSigner('CERTIFICATE_PEM_STRING', 'PRIVATE_KEY_PEM_STRING'),
'http://distribution.example.com',
'CERTIFICATE_PEM_STRING'
);
async function generateXML() {
try {
const xml = await serializer.serialize(providers);
console.log(xml);
} catch (error) {
console.error('Error serializing XML:', error);
}
}
generateXML();
Documentation
For more detailed information on using each feature of @gaia-x/gx-trusted-list-serializer
, refer to our GitLab repository.
Contributing
Interested in contributing to the Gaia-X Trusted List Serializer? Please read our contributing guidelines in our repository to learn how you can get involved.
License
This project is licensed under the EPL-2.0 - see the LICENSE file for details.