Have you copied custom assembly to the ReportServer bin directory (e.g. to
"BALAJI KRISHNAN via SQLMonster.com" <forum@SQLMonster.com> wrote in message
news:05caacfe42a94a4c95e196c9e9cd672b@SQLMonster.com...
> Hi All MSTR Mentor's
>
> I have a RDL, where the stored procedure returns 10 fields among that 1
> field is the creditcard# which is encrypted, I need to decryt the
> creditcard # and display it in the report.
>
> I use a .net custom aseembly which has a decrypt function and it is added
> as a reference to the rdl and it is WORKING FINE when i view the report in
> the PREVIEW TAB of the report designer.
>
> When I deploy the report to my ReportServer of the localmachine and view
> the report it is showing #Error on the field value.
>
> What could be the problem, plese help me on this issue.
>
>
>
>
>
>
>
>
>
>
>
>
> using System;
> using System.Text;
> using System.Collections.Specialized;
> using System.Configuration;
> using System.Security.Cryptography;
> using FCLX509 = System.Security.Cryptography.X509Certificates;
> using WSEX509 = Microsoft.Web.Services2.Security.X509;
> using WSECRY = Microsoft.Web.Services2.Security.Cryptography;
>
> namespace RDLCustomCode
> {
> public class DataDecryptionClass
> {
>
> public DataDecryptionClass()
> {
>
> }
>
> public static string DecryptCardInfo(string cc,string subjectName,string
> storeName)
> {
> try
> {
> string sCreditCard = "";
> WSEX509.X509CertificateStore.StoreLocation location =
> WSEX509.X509CertificateStore.StoreLocation.CurrentUser;
> WSEX509.X509CertificateStore.StoreProvider provider =
> WSEX509.X509CertificateStore.StoreProvider.System;
> WSEX509.X509CertificateStore store = new WSEX509.X509CertificateStore
> (provider, location, storeName);
>
> bool fopen = store.OpenRead();
>
> if(fopen)
> {
> WSEX509.X509CertificateCollection certs =
> store.FindCertificateBySubjectString(subjectName);
> if (certs.Count > 0)
> {
> WSEX509.X509Certificate cer = certs[0];
>
> WSECRY.RSACryptoServiceProvider rsaCsp =
> (WSECRY.RSACryptoServiceProvider)cer.Key;
>
> byte[] cipherData = Convert.FromBase64String(cc);
> byte[] plainData = rsaCsp.Decrypt(cipherData, false);
> sCreditCard = Encoding.UTF8.GetString(plainData);
> }
> }
>
> if (store != null)
> store.Close();
>
> return sCreditCard;
> }
> catch
> {
> return "";
> }
> }
>
> --
> Message posted via
http://www.sqlmonster.com