Home : J-Integra for .NET : How to enable encryption
Q148454 - HOWTO: How to enable encryption

How to enable encryption

 

J-Integra for .NET now supports encryption over TCP/IP or HTTP. This is accomplished through the use of a channel provider on the .NET side that encrypts the data after the binary formatter has been applied. This free provider can be downloaded from GotDotNet. J-Integra for .NET has been verified to work version 1.2.1.0 of the SecureRemoting Provider.

  1. Access Java server from .NET client
  2. Access .NET server from Java client

1. Access Java server from .NET client

  1. You need to get the SecureChannel.dll assembly from Secure Remoting. Once this is built, you'll need to reference it in your .NET client project.

  2. Include the following in your remoting.config file:

    <clientProviders>
      <formatter ref="binary"/>
      <provider type="MsdnMag.Remoting.SecureClientChannelSinkProvider, SecureChannel" algorithm="3DES"/>
    </clientProviders>

    This should be in between the <channel ref="tcp" port="0"> tag.

    A sample remoting.config file utilizing the SecureRemoting channel provider is shown below:

    <configuration>
     <system.runtime.remoting>
      <application>
       <client url="tcp://localhost:8051">
        <ACTIVATED type="Factory, JanetExample" >
       </client>
       <channels>
        <channel ref="tcp" port="0">
         <clientProviders>
          <formatter ref="binary"/>
          <provider type="MsdnMag.Remoting.SecureClientChannelSinkProvider, SecureChannel" algorithm="3DES"/>
         </clientProviders>
        </channel>
       </channels>
      </application>
     </system.runtime.remoting>
    </configuration>


  3. Finally you should add these tags to your janet.xml file.

    <EncryptAlgorithm>3DES</EncryptAlgorithm>
    <EncryptProtocol>SecureRemoting</EncryptProtocol>

    This should be under the <ServerMap> and right above </default> tags.

    A sample <ServerMap> section of the janet.xml file utilizing the SecureRemoting channel provider is shown below:

    <ServerMap>
     <default>
      <RenewOnCallTime>10</RenewOnCallTime>
      <PassByReference>true</PassByReference>
      <InitialContextFactory></InitialContextFactory>
      <ProviderURL></ProviderURL>
      <LeaseTime>10</LeaseTime>
      <PropertySettings>
      </PropertySettings>
      <RenewOnCallUnit>1</RenewOnCallUnit>
      <ActivationMode>0</ActivationMode>
      <URI>tcp://localhost:8051/</URI>
      <AssemblyName>JanetExample</AssemblyName>
      <LeaseUnit>1</LeaseUnit>
      <EncryptAlgorithm>3DES</EncryptAlgorithm>
      <EncryptProtocol>SecureRemoting</EncryptProtocol>

     </default>
    </ServerMap>

2. Access .NET server from Java client

  1. You need to get the SecureChannel.dll assembly from Secure Remoting. Once this is built, you'll need to reference it in your .NET server project.

  2. Include the following in your remoting.config file:

    <serverProviders>
      <provider
        type="MsdnMag.Remoting.SecureServerChannelSinkProvider, SecureChannel"
        algorithm="3DES"
        oaep="false"
        requireSecurity="true"
        securityExemptionList="127.0.0.1"
        connectionAgeLimit="120"
        sweepFrequency="60"
      />
      <formatter ref="binary" typeFilterLevel="Full"/>
    </serverProviders>

    This should be in between the <channel ref="tcp" port="0"> tag.

    You can add more IP in securityExemptionList as:

    securityExemptionList="127.0.0.1;196.168.2.3"

  3. Finally you should add these tags to your janet.xml file.

    <EncryptAlgorithm>3DES</EncryptAlgorithm>
    <EncryptProtocol>SecureRemoting</EncryptProtocol>


    This should be for each Object under the <ClientMap> tag including <default>.
    A sample <ClientMap> section of the janet.xml file utilizing the SecureRemoting channel provider is shown below:

    <ClientMap>
      <default>
        <AuthMethod>None</AuthMethod>
        <URI>tcp://localhost:7561</URI>
        <ActivationMode>1</ActivationMode>
        <AuthUserid></AuthUserid>
        <AuthPassword></AuthPassword>
        <Format>binary</Format>
        <EncryptAlgorithm>3DES</EncryptAlgorithm>
        <EncryptProtocol>SecureRemoting</EncryptProtocol>
      </default>
      <csharp_server.ClassByReference>
        <AuthMethod>None</AuthMethod>
        <AuthPassword></AuthPassword>
        <AuthUserid></AuthUserid>
        <ActivationMode>0</ActivationMode>
        <URI>tcp://localhost:7561</URI>
        <Format>binary</Format>
        <EncryptAlgorithm>3DES</EncryptAlgorithm>
        <EncryptProtocol>SecureRemoting</EncryptProtocol>
      </csharp_server.ClassByReference>
    </ClientMap>
Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/23/2006.
Last Modified on 7/10/2006.
Last Modified by No Author Name Available!.
Article has been viewed 14114 times.
Rated 3 out of 10 based on 11 votes.
Print Article
Email Article