[botan-devel] Botan and Signed-and-Enveloped-Data - question

Roberto Petrillo petrillo.r0 at gmail.com
Sat Feb 6 06:17:36 EST 2016

Good morning everyone!
I've recently started to use Botan and I'm really enjoying the potential of
this library!
I've a *quick question* and I hope you guys will have 2 minutes of your
time to point me in the right direction.

*Problem description*: *I must create a simple utility that, given a text
file in input, produces a Signed-and-Enveloped-Data type data structure,
according to PKCS#7* (https://tools.ietf.org/html/rfc2315#section-11.1).
The output should be serializable to file and printable (sort of
X509::PEM_encode() output for certificates).

*Example Use Case*:
Alice has *Priv_Alice* and* Pub_Alice* keys.
Bob has *Message.txt*, *Priv_Bob* and *Pub_Bob* keys.
Bob uses the aforementioned tool: *./tool Message.txt Pub_Alice Priv_Bob*
The tool produces: *sign_and_enveloped_Message.txt* which contains:
- *Encrypted message* with a content-encryption key generated during the
- *RecipientInfo*: {Name: 'Alice', Encrypted-Content Key: <generated during
the process>}
- *SignerInfo*: {Name: 'Bob', MDA: 'SHA-256', doubly-encrypted-digest:
<generated during the process>}
Bob sends the result to Alice.
Alice uses the same tool to revert the process and enjoy Bob's message.

*Question*: *is it possible to perform this task with Botan classes without
re-inventing the wheel?* I've already played a little with
encryption/decryption classes, but I couldn't find any straightforward way
to do so.
I'm also ready to write the whole data structure, primitives of handling
the custom format, etc... but probably I'm just planning to shoot a
butterfly with a cannon and I lack of Botan experience to know what to edit
and where.

*Any hint and suggestion is more than welcome!* I understand that I'm
bothering you all on Saturday and I'm really sorry for that! :P **One free
beer** for those kind souls who will give me a hand on this matter!

Thanks and have a nice weekend!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20160206/b6c3803d/attachment.html>

More information about the botan-devel mailing list