@multi-serializer/rsa
v0.1.0
Published
This project is just a template for creation of new projects
Downloads
2
Maintainers
Keywords
Readme
This library delivers a RSA serializer and deserializer, fit to be used with multi-serializer;
How to Install
npm i @multi-serializer/rsa
How to use
By itself:
const rsa = new RsaStrategy({ key, type: 'public'});
const serialized = await rsa.serialize(info); // this result is buffer
const origin = await rsa.deserialize(incomingMessage); // this result is also a buffer
Or adding it in the strategy chain of multi-serializer:
const serializer = new Serializer(
new JsonStrategy(),
new GzipStrategy(),
new RsaStrategy({ key, type: 'public'}),
new Base64Strategy(),
);
const serialized = await serializer.serialize(info);
const origin = await serializer.deserialize(incomingMessage);
License
Licensed under MIT.