473,748 Members | 8,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Digital Signature

Kim
I have a .NET service sending mails using CDOEX.

These mails I need to sign. I got a tip that I should use CAPICOM. That
worked
fine sending a mail with signature.

BUT the problem is that I have to type the password for my certificate every
time my program signs a mail :o(

My program is a windows service running on a server so typing passwords is
bad.

Then I got a new tip, I should use CryptoAPI instead of CAPICOM.

I think I have solved the CryptoAPI mystic and got my certificate, signed my
body of the mail and got the hash for it. But I don't know how to get my
signed code into the mail?

The code looks like this, and gives this error when the outlook client
reseive the mail:

Error: Can't open this item. Your Digital ID name can not be found by the
underlying security system.

This takes a byte array that I send from my CryptoAPI code.
Code:

private void SendMail(byte[] byteSignature)
{
CDO.IBodyPart oBodyPart;
ADODB.Fields cFields;
ADODB.Stream oStream;

// set sender, recipient, and subject.
oMessage = new CDO.Message();

oMessage.To = "re**********@D omain.dk";
oMessage.Subjec t = "Test Mail";
oMessage.Fields["urn:schemas:ma ilheader:date"].Value = DateTime.UtcNow ;
oMessage.Fields .Update();

oMessage.From = "my*****@domain .dk";

oBodyPart = oMessage.BodyPa rt.AddBodyPart( 1);
cFields = oBodyPart.Field s;

cFields["urn:schemas:ma ilheader:conten t-type"].Value =
CDO.CdoContentT ypeValues.cdoTe xtPlain;
cFields.Update( );

oStream = oBodyPart.GetDe codedContentStr eam();
oStream.WriteTe xt("Hello this is some test text",0);
oStream.Flush() ;

//
//
// Start the new message
//
//
CDO.Message oSignedMsg = new CDO.Message();
CDO.IBodyPart oBodyPart2;
ADODB.Fields cFields2;
ADODB.Stream oStream2;

oSignedMsg.From = "My*****@domain .dk";

// this is to be a clear text signed message so we need to copy the
interesting
// parts (sender, recipient, and subject) into the new header
oSignedMsg.To = oMessage.To;
oSignedMsg.CC = oMessage.CC;
oSignedMsg.Subj ect = oMessage.Subjec t;

oBodyPart2 = oSignedMsg.Body Part.AddBodyPar t(1);
cFields2 = oBodyPart2.Fiel ds;

cFields2["urn:schemas:ma ilheader:conten t-type"].Value =
oMessage.BodyPa rt.BodyParts[1].Fields["urn:schemas:ma ilheader:conten t-type"].Value;
cFields2.Update ();

// Attach the signature and let CDO base64 encode it
oBodyPart2 = oSignedMsg.Body Part.AddBodyPar t(1);
cFields2 = oBodyPart2.Fiel ds;
oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-type"].Value =
"applicatio n/x-pkcs7-signature\rName = " + '\u0022' + "smime.p7s" + '\u0022'
+ "";

oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-transfer-encoding"].Value =
"base64";
oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-disposition"].Value =
"attachment;\rF ileName=" + '\u0022' + "smime.p7s" + '\u0022' + "";
cFields2.Update ();
//
oStream2 = oBodyPart2.GetD ecodedContentSt ream();
oStream2.Type = ADODB.StreamTyp eEnum.adTypeBin ary;
oStream2.Write (byteSignature) ;
oStream2.Flush( );

// Set the messages content type, this needs to be done last to ensure
it is not changed when we add the BodyParts

oSignedMsg.Fiel ds["urn:schemas:ma ilheader:conten t-type"].Value =
"multipart/signed;\rprotoc ol=" + '\u0022' + "applicatio n/x-pkcs7-signature" +
'\u0022' + ";\rmicalg=SHA1 ;";

oSignedMsg.Fiel ds.Update();

oMessage = oSignedMsg;
oMessage.Send() ;
}
Jul 21 '05 #1
12 10698
Hi

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hello,
Based on my understanding, you are trying to send encrypted email from
UserA to UserB, but get following error in UserB.
Error: Can't open this item. Your Digital ID name can not be found by the
underlying security system.

This error indicates that the recipient(s) that does not have a Digital ID
should either obtain one or an unencrypted message should be sent. The
certificates you have for the recipients listed are not valid. They may
have expired, may be the wrong type, or may not be supported by your
security policy. You will need to get/set new certificates from/to the
recipients so that the encrypted message could be decrypted successfully.
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Jul 21 '05 #3
Kim
Hello,

My Certificate is working perfect.

If I use CAPICOM to send a Sign Mail there is no problem.

To test it I send the mail to my self and I worked perfect with CAPICOM, but
with my code using CryptoAPI + the code here I got the error.

I had talked to some CryptoAPI guys and they say that my CryptoAPI code
should be fine but if you think my Mail code is correct you can se my
CryptoAPI code.

Best Regards

Kim

"Rhett Gong [MSFT]" wrote:
Hello,
Based on my understanding, you are trying to send encrypted email from
UserA to UserB, but get following error in UserB.
Error: Can't open this item. Your Digital ID name can not be found by the
underlying security system.

This error indicates that the recipient(s) that does not have a Digital ID
should either obtain one or an unencrypted message should be sent. The
certificates you have for the recipients listed are not valid. They may
have expired, may be the wrong type, or may not be supported by your
security policy. You will need to get/set new certificates from/to the
recipients so that the encrypted message could be decrypted successfully.
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Jul 21 '05 #4
Please post out your code and let me know which line fails.

Thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Jul 21 '05 #5
Kim
There is no error exception in the code, it compiles and run perfectly no
errors.

The error comes when the receiver of the mail tryes to open the mail and
outlook want to open the mail.

The Crypto code:

Just put it into a C# form:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;
using System.Security .Cryptography;
using System.Runtime. InteropServices ;
using System.Security .Cryptography.X 509Certificates ;
//using System.Text;

namespace SecuritySample
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows. Forms.Form
{
CDO.Message oMessage = new CDO.Message();

/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeCompo nent();

//
// TODO: Add any constructor code after InitializeCompo nent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(292, 266);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.Form1 _Load);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run (new Form1());
}

private void Form1_Load(obje ct sender, System.EventArg s e)
{
SendMail();
}

const uint CERT_KEY_PROV_I NFO_PROP_ID = 2;
const uint ALG_CLASS_HASH = (4 << 13);
const uint ALG_TYPE_ANY = 0;
const uint ALG_SID_SHA = 4;
const uint CALG_SHA = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA);
const uint AT_SIGNATURE = 2;
const uint PP_KEYEXCHANGE_ PIN = 32;
const uint PP_SIGNATURE_PI N = 33;
const uint CERT_KEY_PROV_H ANDLE_PROP_ID = 1;
const uint CERT_STORE_NO_C RYPT_RELEASE_FL AG = 1;
const uint X509_ASN_ENCODI NG = 0x00000001;
const uint PKCS_7_ASN_ENCO DING = 0x00010000;

[DllImport("cryp t32.dll", SetLastError=tr ue)]
public static extern IntPtr CertDuplicateCe rtificateContex t(
IntPtr pCertContext
);

[DllImport("cryp t32.dll", SetLastError=tr ue)]
public static extern IntPtr CertEnumCertifi catesInStore(
IntPtr hCertStore,
IntPtr pPrevCertContex t
);
[DllImport("cryp t32.dll", SetLastError=tr ue)]
public static extern IntPtr CertOpenSystemS tore(
IntPtr hprov,
string szSubsystemProt ocol
);

[DllImport("cryp t32.dll", SetLastError=tr ue)]
public static extern bool CertGetCertific ateContextPrope rty(
IntPtr pCertContext,
uint dwPropId,
IntPtr pvData,
ref uint pcbData);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptAcquireCon text(
ref IntPtr phProv,
string pszContainer,
string pszProvider,
uint dwProvType,
uint dwFlags);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptCreateHash (
IntPtr hProv,
int Algid,
IntPtr hKey,
uint dwFlags,
ref IntPtr phHash);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptHashData(
IntPtr hHash,
IntPtr pbData,
uint dwDataLen,
uint dwFlags);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptSetProvPar am(
IntPtr hProv,
uint dwParam,
IntPtr pbData,
uint dwFlags
);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptSignHash(
IntPtr hHash,
uint dwKeySpec,
string sDescription,
uint dwFlags,
IntPtr pbSignature,
ref uint pdwSigLen
);

[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptDestroyHas h(
IntPtr hHash
);
[DllImport("Adva pi32.dll", SetLastError=tr ue)]
public static extern bool CryptReleaseCon text(
IntPtr hProv,
uint dwFlags
);

[DllImport("Cryp t32.dll", SetLastError=tr ue)]
public static extern bool CertSetCertific ateContextPrope rty(
IntPtr pCertContext,
uint dwPropId,
uint dwFlags,
IntPtr pvData
);

[StructLayoutAtt ribute(LayoutKi nd.Sequential, CharSet=CharSet .Auto)]
internal struct CRYPT_KEY_PROV_ INFO
{
[MarshalAs(Unman agedType.LPWStr )]
public string pwszContainerNa me;
[MarshalAs(Unman agedType.LPWStr )]
public string pwszProvName;

// public IntPtr pwszContainerNa me;
// public IntPtr pwszProvName;

public uint dwProvType;
public uint dwFlags;
public uint cProvParam;
public uint rgProvParam;
public uint dwKeySpec;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Ansi)]
public struct CRYPTOAPI_BLOB
{
public int cbData;
public IntPtr pbData;
}

[StructLayoutAtt ribute(LayoutKi nd.Sequential, CharSet=CharSet .Auto)]
public struct CRYPT_ALGORITHM _IDENTIFIER
{
[MarshalAs(Unman agedType.LPStr)]
public string pszObjId;
public CRYPTOAPI_BLOB Parameters;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Ansi)]
public struct CRYPT_SIGN_MESS AGE_PARA
{
public UInt32 cbSize;
public UInt32 dwMsgEncodingTy pe;
public IntPtr pSigningCert;
public CRYPT_ALGORITHM _IDENTIFIER HashAlgorithm;
public IntPtr pvHashAuxInfo;
public UInt32 cMsgCert;
public IntPtr rgpMsgCert;
public UInt32 cMsgCrl;
public IntPtr rgpMsgCrl;
public UInt32 cAuthAttr;
public IntPtr rgAuthAttr;
public UInt32 cUnauthAttr;
public IntPtr rgUnauthAttr;
public UInt32 dwFlags;
public UInt32 dwInnerContentT ype;
public CRYPT_ALGORITHM _IDENTIFIER HashEncryptionA lgorithm;
public IntPtr pvHashEncryptio nAuxInfo;
}

[DllImport("Cryp t32.dll", EntryPoint="Cry ptSignMessage")]
public static extern bool CryptSignMessag e(
ref CRYPT_SIGN_MESS AGE_PARA pSignPara,
bool fDetachedSignat ure,
UInt32 cToBeSigned,
string[] rgpbToBeSigned,
int[] rgcbToBeSigned,
IntPtr pbSignedBlob,
ref UInt32 pcbSignedBlob);

private void HandleError(str ing s) {throw new Exception(s);}

IntPtr GetCertificate( )
{
IntPtr hCertStore = CertOpenSystemS tore(IntPtr.Zer o, "MY");
// Hvis pointeren er = 0 SÃ¥ kunne den ikke finde STOREN
if (hCertStore.ToI nt32() == 0)
{
MessageBox.Show ("CertOpenSyste mStore failed: " +
Marshal.GetLast Win32Error().To String());
return System.IntPtr.Z ero ;
}
IntPtr pCertContext = CertEnumCertifi catesInStore(hC ertStore, IntPtr.Zero);
IntPtr tmp = CertDuplicateCe rtificateContex t(pCertContext) ;
// Sender en pointer til det første Certificat i MY STOREen
//signHash(tmp);
return tmp;
}

byte[] signHash(string BodyText)
{
IntPtr pCert = GetCertificate( );

CRYPT_KEY_PROV_ INFO pKeyProvInfo = new CRYPT_KEY_PROV_ INFO();
IntPtr pbKeyProvInfo=I ntPtr.Zero;
uint cbKeyProvInfo=0 ;
IntPtr hProv = IntPtr.Zero;
IntPtr hHash = IntPtr.Zero;
IntPtr pbSignature = IntPtr.Zero;
uint dwSigLen=0;

// Call method to get size of buffer. The number of bytes needed goes
into cbKeyProvInfo
IntPtr Tmp = IntPtr.Zero;
CertGetCertific ateContextPrope rty(pCert, CERT_KEY_PROV_I NFO_PROP_ID, Tmp,
ref cbKeyProvInfo);

// Allocate needed memory and call again with the correct buffer
preallocated
pbKeyProvInfo = Marshal.AllocHG lobal(new IntPtr(cbKeyPro vInfo));

if (!CertGetCertif icateContextPro perty(pCert, CERT_KEY_PROV_I NFO_PROP_ID,
pbKeyProvInfo, ref cbKeyProvInfo))
HandleError("Ce rtGetCertificat eContextPropert y failed");

pKeyProvInfo = (CRYPT_KEY_PROV _INFO)Marshal.P trToStructure(p bKeyProvInfo,
typeof(CRYPT_KE Y_PROV_INFO));

string name = pKeyProvInfo.pw szProvName;
string cont = pKeyProvInfo.pw szContainerName ;
if(name != "CRYPTOMATH iC RSA Full Provider 1.2")
return null;

if(!CryptAcquir eContext(ref hProv,
//pKeyProvInfo.pw szContainerName ,
cont,
//pKeyProvInfo.pw szProvName,
name,
pKeyProvInfo.dw ProvType,
pKeyProvInfo.dw Flags))
HandleError("Cr yptAcquireConte xt failed");

IntPtr ProvData = Marshal.StringT oHGlobalAnsi("P assword");
if(pKeyProvInfo .dwKeySpec==AT_ SIGNATURE)
{
if(!CryptSetPro vParam(hProv, PP_SIGNATURE_PI N, ProvData, 0))
{
//Marshal.FreeHGl obal(Data);
HandleError("Cr yptSetProvParam failed");
}
}
else
{
if(!CryptSetPro vParam(hProv, PP_KEYEXCHANGE_ PIN, ProvData, 0))
{
//Marshal.FreeHGl obal(Data);
HandleError("Cr yptSetProvParam failed");
}
}
//Marshal.FreeHGl obal(Data);

CertSetCertific ateContextPrope rty(pCert, CERT_KEY_PROV_H ANDLE_PROP_ID,
CERT_STORE_NO_C RYPT_RELEASE_FL AG, hProv);
CRYPT_SIGN_MESS AGE_PARA signParams;
signParams = new CRYPT_SIGN_MESS AGE_PARA();
signParams.cbSi ze = (uint) Marshal.SizeOf( typeof(CRYPT_SI GN_MESSAGE_PARA ));
signParams.dwMs gEncodingType = PKCS_7_ASN_ENCO DING | X509_ASN_ENCODI NG;
signParams.pSig ningCert = pCert;
signParams.Hash Algorithm.pszOb jId = "1.2.840.113549 .1.1.5";
signParams.Hash Algorithm.Param eters.cbData = 0;
signParams.pvHa shAuxInfo = new IntPtr(0);
signParams.cMsg Cert = 1;
signParams.rgpM sgCert = Marshal.AllocCo TaskMem ( Marshal.SizeOf
(typeof(IntPtr) ));
Marshal.Structu reToPtr (pCert, signParams.rgpM sgCert, true);
signParams.cMsg Crl = 0;
signParams.rgpM sgCrl = new IntPtr(0);
signParams.cAut hAttr = 0;
signParams.rgAu thAttr = new IntPtr(0);
signParams.cUna uthAttr = 0;
signParams.rgUn authAttr = new IntPtr(0);
signParams.dwFl ags = 0;
signParams.dwIn nerContentType = 0;

string[] ConvertedString = {BodyText};
int[] sizes = {ConvertedStrin g[0].Length};
CryptSignMessag e (ref signParams, true, 1, ConvertedString , sizes,
IntPtr.Zero, ref dwSigLen);
pbSignature= Marshal.AllocHG lobal((int)dwSi gLen);
CryptSignMessag e (ref signParams, true, 1, ConvertedString , sizes,
pbSignature, ref dwSigLen);

byte[] output = new byte[dwSigLen];
Marshal.Copy(pb Signature,outpu t,0,Convert.ToI nt32(dwSigLen)) ;
try
{
//SendMail(output );
return output;
}
catch(System.Ex ception ex)
{
MessageBox.Show (ex.Message);
}

if(!CryptReleas eContext(hProv, 0))
HandleError("Cr yptReleaseConte xt failed");

Marshal.FreeHGl obal(pbKeyProvI nfo);
Marshal.FreeHGl obal(pbSignatur e);
return null;
}

private void SendMail()
{
CDO.IBodyPart oBodyPart;
ADODB.Fields cFields;
ADODB.Stream oStream;

// set sender, recipient, and subject.
oMessage = new CDO.Message();
oMessage.To = "my****@domain. com";
oMessage.Subjec t = "Test Mail";
oMessage.Fields["urn:schemas:ma ilheader:date"].Value = DateTime.UtcNow ;
// oUtilities.Loca lTimeToUTCTime( DateTime.Now);
oMessage.TextBo dy = "Hello this is a test mail";
oMessage.From = "my****@domain. com";
oMessage.Fields .Update();

oBodyPart = oMessage.BodyPa rt.AddBodyPart( 1);
cFields = oBodyPart.Field s;
//cFields[CDO.CdoMailHead er.cdoContentTy pe].Value =
CDO.CdoContentT ypeValues.cdoTe xtPlain;
cFields["urn:schemas:ma ilheader:conten t-type"].Value =
CDO.CdoContentT ypeValues.cdoTe xtPlain;
cFields.Update( );

oStream = oBodyPart.GetDe codedContentStr eam();
oStream.WriteTe xt("Hello This is at test message :o)",0);
oStream.Flush() ;

//
//
// Start the new message
//
//
CDO.Message oSignedMsg = new CDO.Message();
CDO.IBodyPart oBodyPart2;
ADODB.Fields cFields2;
ADODB.Stream oStream2;

// set the from field based off of the selected certificate
oSignedMsg.From = "my****@domain. com";
oSignedMsg.Data Source.OpenObje ct(oMessage,
CDO.CdoInterfac es.cdoIMessage) ;
// this is to be a clear text signed message so we need to copy the
interesting
// parts (sender, recipient, and subject) into the new header
oSignedMsg.To = oMessage.To;
oSignedMsg.CC = oMessage.CC;
oSignedMsg.Subj ect = oMessage.Subjec t;

oBodyPart2 = oSignedMsg.Body Part.AddBodyPar t(1);
cFields2 = oBodyPart2.Fiel ds;
//cFields2[CDO.CdoMailHead er.cdoContentTy pe].Value =
oMessage.BodyPa rt.BodyParts[1].Fields[CDO.CdoMailHead er.cdoContentTy pe].Value;
cFields2["urn:schemas:ma ilheader:conten t-type"].Value =
oMessage.BodyPa rt.BodyParts[1].Fields["urn:schemas:ma ilheader:conten t-type"].Value;
cFields2.Update ();

// Attach the signature and let CDO base64 encode it
oBodyPart2 = oSignedMsg.Body Part.AddBodyPar t(1);
cFields2 = oBodyPart2.Fiel ds;
oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-type"].Value =
"applicatio n/x-pkcs7-signature\rName = " + '\u0022' + "smime.p7s" + '\u0022'
+ "";
oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-transfer-encoding"].Value = "base64";
oBodyPart2.Fiel ds["urn:schemas:ma ilheader:conten t-disposition"].Value =
"attachment;\rF ileName=" + '\u0022' + "smime.p7s" + '\u0022' + "";
cFields2.Update ();
//
oStream2 = oBodyPart2.GetD ecodedContentSt ream();
oStream2.Type = ADODB.StreamTyp eEnum.adTypeBin ary;
oStream2.Write (byteSignature) ;

oStream2.Flush( );
//
// Set the messages content type, this needs to be done last to ensure it
is not changed when we add the BodyParts
oSignedMsg.Fiel ds["urn:schemas:ma ilheader:conten t-type"].Value =
"multipart/signed;\rprotoc ol=" + '\u0022' + "applicatio n/x-pkcs7-signature" +
'\u0022' + ";\rmicalg=SHA1 ;";
oSignedMsg.Fiel ds.Update();
oMessage = oSignedMsg;

//oMessage.Send() ;
oSignedMsg.Send ();
}
}
}

Jul 21 '05 #6
Hello Kim,
Are you sure your code you posted can work perfectly?
I found this line oStream2.Write (byteSignature) ; seems you did not declare
byteSignature anywhere and you did not use your cert to sign the textbody
before sending them.

I am currently trying to make your code work in my side and i will update
you later.

Thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Jul 21 '05 #7
Kim
Hello Rhett Gong,

You say that you would update me later when you had something up and
running, what happen? I haven't heard from you!

It would be nice if you could find a solution for me.

Thanks

Kim

"Rhett Gong [MSFT]" wrote:
Hello Kim,
Are you sure your code you posted can work perfectly?
I found this line oStream2.Write (byteSignature) ; seems you did not declare
byteSignature anywhere and you did not use your cert to sign the textbody
before sending them.

I am currently trying to make your code work in my side and i will update
you later.

Thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Jul 21 '05 #8
Hi Kim,

We are really sorry for the late response. Ray is out of office and will be
back on next Monday. I will look for somebody look into it first.

Thanks very much for your understanding.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microso ft.com/default.aspx?sc id=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #9
Hi Kim,

I'm checked your code. Just as Rhett suggested, I didn't find the
declaration of it in the code you have provided. Is it the array which
contains the byte array of email signature? Could you provide us with more
information?

Here I think you have to call signHash to sign the body text before
assigning it directly to the oMessage.TextBo dy property.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1161
by: Kim H Madsen | last post by:
I have created a .Net Service that is sending mails using SMTP Server/Exchange Server how do i put in a Digital Signature so the reciver is 100% sure that the mail i from the owner of Server where the Service is running ? It should worke something lige Outlook does it you type in your secret password and Outlook together with the code create a Mail with digital signature Thank Ki If I have to use another way of sending mails to use...
7
7653
by: Guangxi Wu | last post by:
Hi all, Happy New Year. I am using SignedXML and an X509 certificate to digitally sign a SOAP message body and put the signature in the SOAP header for a B2B business application. Can you suggest which type of digital certificates from VeriSign is for this purpose? I checked VeriSign's web site but didn't find it obvious to decide.
5
4829
by: John Campbell | last post by:
Hi everyone I've been doing my best to understand the specifics of implimentating XML Digital Signatures, but I seem to be missing a fundamental concept. Let me start with a description of the problem I am trying to solve. In my application, people send an XML file that contains data for loans. The application then takes that data and performs various calculations returning the results in an XML file that combines both the initial data and...
0
1575
by: CLarkou | last post by:
I bought a digital signature for my MSaccess application in Office 2003. I select TOOLS\Digital Signatures in Visual Basic Editor and I am not able to see my digital signature in the available ones. No BROWSE button available. Is there any directory I should copy it into ?
2
3676
by: Martin Høst Normark | last post by:
Hi everyone Has anyone got the least experience in integrating the Digital Signature with an ASP.NET Web Application? Here in Denmark, as I supose in many other countries, they're promoting the digital signature. A lot of people already has one, to do their taxes, and much more. I have to use for a business-to-business e-commerce solution, where it's vital that the right user is being logged on, and not give his username and password...
6
11560
by: Matt Frame | last post by:
I have a client that has asked us to get a digital signature certificate and start digitally signing all files we pass between each other. I have heard of the subject and know about the certs but I have no idea how to do something like this with VB.Net. Has anyone done something like this or know where I can find out information how to perform the process of signing a document when sending it then checking one on receipt? Your help is...
1
6237
by: claudia_usa | last post by:
Hello, Does anyone know how to include the signature field when creating PDF crystal reports with VB.net? Our intension is to allow the user to generate the report with their digital signature included or at least with the signature field available within Adobe Reader so that it can be signed independently with Reader. Is there an SDK, plug-in or license that we need?
0
2588
by: Geagleeye | last post by:
Hi everyone. I have some vba code to generate a pdf document through word, and add also digital signature. My problem is : how can i change the way the signature layout, it always show the same standard signature image look. I have tryed to change my signature field whit my own logo and so on in acrobat, and named it as signtaure 2, but how can i use that
3
2797
by: itcoll | last post by:
i have wriiten java code for client server communication - the client sends a digital signature and the server verifies it using the public key .I have sent the signature as a string from the client to server.although the verification comes as true most of the times , some times it comes as "false" .i dont know why it comes that way . so my question is ::: is there any problem in sending the digital signature as a string. if so , then how can...
3
3173
by: tmoloy | last post by:
I am using RFID tags to store some data which will then be read by a 3rd party. I need to include a digital signature (or some variation) along with the data so that the 3rd party can verify the authenticity of the tag. Straightforward enough. But the problem is that I am constrained by the RFID tag's 32-byte memory array. My application is written in C# (.NET 3.5) and the available digital signature class (DSACryptoServiceProvider) results...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.