Discussion:
BizTalk Pipeline Component Integration with Open PGP
(too old to reply)
BenS
2005-06-16 05:17:06 UTC
Permalink
Currently BizTalk Server 2004 only supports S/MIME in the Pipeline
encode/decode components as standard.
Is there a way of using OpenPGP in the Pipeline encode/decode components?
If a custom component needs to be created do you have any examples?

Found following paragraph on msdn - "Guidelines for Application Integration"
but not much else.

Encode/Decode
BizTalk Server supports document encoding and decoding through the receive
and send pipelines. You can decode documents received by BizTalk Server that
have been encoded in a specific format (for example EBCDIC from a mainframe,
or SMIME for security) within the receive pipeline, prior to processing by
BizTalk Server. Similarly, you can encode documents sent from BizTalk Server
using an encoding stage in the send pipeline. You can also create custom
encoder/decoder pipeline components for use within the pipelines, such as a
Pretty Good Privacy (PGP) component.

Cheers
Ben
Tomas Restrepo (MVP)
2005-06-16 11:21:45 UTC
Permalink
Hi Ben,
Post by BenS
Currently BizTalk Server 2004 only supports S/MIME in the Pipeline
encode/decode components as standard.
Is there a way of using OpenPGP in the Pipeline encode/decode components?
If a custom component needs to be created do you have any examples?
Yep, you'd need to create a custom pipeline component... well, two actually,
a decoding component, and an encoding component so that you can use both
receive and send pipelines.

The best place to start is the documentation (make sure you have the updated
one). Look under: SDK -> Programming Guide -> Developing Pipelines ->
Developing Pipeline Components.

The SDK also has a custom pipeline component sample called FixMsg. It's not
a decoding/encoding component, but it servers well as an example.
--
Tomas Restrepo
***@mvps.org
http://www.winterdom.com/
BenS
2005-06-17 08:41:03 UTC
Permalink
Firstly thank you Alan & Tomas.

I have been looking at the SDK examples (FixMsg and BAMEndToEnd) and both
are good examples of how to create a custom pipeline component, but creating
the component is not really the issue.
It is how to get the custom pipeline component to encrypt or decrypt using
PGP.

The IComponent interface requires the following "Execute" method to be defined

"public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)"

From IBaseMessage you get a Byte Stream of the BizTalk message you are
processing.

The Byte Stream is what I would like to encrypt/decrypt (using PGP).

I have looked around at a few of the .NET libaries for doing this
(SecureBlackBox, SharpPrivacyLibrary) but they are all expecting a File
Handle in the method calls for Encrypting/Decrypting, which I don't have.

Not sure if I have headed down the correct path with my approach or not. Any
suggestions or alternates would be appriciated.

Cheers
Ben.
Alan Smith
2005-06-17 10:04:07 UTC
Permalink
Hi Ben,

You will need to use a code library that will process either a .net stream,
or a string.

Processing a stream is the most performant, if you can find code that will
support this. The other option is to read your message into a string,
encode/decode it, then write it back out again to a stream. This carries a
bit of a performance hit as you need to load the message into RAM to process
it.

I don't know of any code that will support this for Open PGP (maybe some
other newsgroup can help you out there), but i think there are some encoding
components in the .net framework if you can go that way.

Regards,

Alan
--
The Bloggers Guide to BizTalk
http://geekswithblogs.com/asmith
Post by BenS
Firstly thank you Alan & Tomas.
I have been looking at the SDK examples (FixMsg and BAMEndToEnd) and both
are good examples of how to create a custom pipeline component, but creating
the component is not really the issue.
It is how to get the custom pipeline component to encrypt or decrypt using
PGP.
The IComponent interface requires the following "Execute" method to be defined
"public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)"
From IBaseMessage you get a Byte Stream of the BizTalk message you are
processing.
The Byte Stream is what I would like to encrypt/decrypt (using PGP).
I have looked around at a few of the .NET libaries for doing this
(SecureBlackBox, SharpPrivacyLibrary) but they are all expecting a File
Handle in the method calls for Encrypting/Decrypting, which I don't have.
Not sure if I have headed down the correct path with my approach or not. Any
suggestions or alternates would be appriciated.
Cheers
Ben.
Bill
2005-06-17 19:34:39 UTC
Permalink
I have written custom BizTalk PGP components. For example, to encode,
you can use the BizTalk message as the input (pInMsg.BodyPart.Data) and
a MemoryStream for the output stream; then encrypt using the
SecureBlackBox api and then place the encrypted data back into the
BizTalk message stream (pInMsg.BodyPart = outstream;). I can't share
the code as it belongs to a client, sorry.
jonesb321
2007-08-03 20:44:03 UTC
Permalink
Just scanning through, and I ran across this one. I too have written a PGP
PipelineComponent. However, I can share it.

http://bajwork.spaces.live.com/blog/cns!2BA8444DD234C287!161.entry

HTH -
--
Brian
http://bajwork.spaces.live.com/
Post by Bill
I have written custom BizTalk PGP components. For example, to encode,
you can use the BizTalk message as the input (pInMsg.BodyPart.Data) and
a MemoryStream for the output stream; then encrypt using the
SecureBlackBox api and then place the encrypted data back into the
BizTalk message stream (pInMsg.BodyPart = outstream;). I can't share
the code as it belongs to a client, sorry.
Alan Smith
2005-06-16 16:08:11 UTC
Permalink
Hi Ben,

You will need to create a cunstom component for this. It's not too hard to
do if you have some VB.net or C# coding experience. There's a few resources
telling you how to go about this:

Check the SDK samples that are installed with BizTalk (and download the SDK
refresh).
There's some posts on this in the Bloggers Guide to Bizalk (check my
bloglink below for the latest update).
There's also a section on this in the BizTalk Server 2004 Unleashed book.
There's also another thred on this here:
http://groups.msn.com/biztalkserverstuff/general.msnw?action=get_message&mview=0&ID_Message=2046&LastModified=4675524833578683966

Regards,

Alan
--
The Bloggers Guide to BizTalk
http://geekswithblogs.com/asmith
Post by BenS
Currently BizTalk Server 2004 only supports S/MIME in the Pipeline
encode/decode components as standard.
Is there a way of using OpenPGP in the Pipeline encode/decode components?
If a custom component needs to be created do you have any examples?
Found following paragraph on msdn - "Guidelines for Application Integration"
but not much else.
Encode/Decode
BizTalk Server supports document encoding and decoding through the receive
and send pipelines. You can decode documents received by BizTalk Server that
have been encoded in a specific format (for example EBCDIC from a mainframe,
or SMIME for security) within the receive pipeline, prior to processing by
BizTalk Server. Similarly, you can encode documents sent from BizTalk Server
using an encoding stage in the send pipeline. You can also create custom
encoder/decoder pipeline components for use within the pipelines, such as a
Pretty Good Privacy (PGP) component.
Cheers
Ben
JeffP
2005-07-08 12:52:03 UTC
Permalink
You can find a wrapper class for the GNuPG software to use in custom
pipelines here:
http://www.codeproject.com/csharp/gnupgdotnet.asp?df=100&forumid=13347&exp=0&select=767897

GnuPG can be found at http://www.gnupg.org/
Post by BenS
Currently BizTalk Server 2004 only supports S/MIME in the Pipeline
encode/decode components as standard.
Is there a way of using OpenPGP in the Pipeline encode/decode components?
If a custom component needs to be created do you have any examples?
Found following paragraph on msdn - "Guidelines for Application Integration"
but not much else.
Encode/Decode
BizTalk Server supports document encoding and decoding through the receive
and send pipelines. You can decode documents received by BizTalk Server that
have been encoded in a specific format (for example EBCDIC from a mainframe,
or SMIME for security) within the receive pipeline, prior to processing by
BizTalk Server. Similarly, you can encode documents sent from BizTalk Server
using an encoding stage in the send pipeline. You can also create custom
encoder/decoder pipeline components for use within the pipelines, such as a
Pretty Good Privacy (PGP) component.
Cheers
Ben
Loading...