Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: DomainKeys Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jing.wang
Newbie
Newbie


Joined: 22 October 2009
Online Status: Offline
Posts: 1
Posted: 22 October 2009 at 3:10am | IP Logged Quote jing.wang

Hi
I tried to sign a message with DomainKeys
signature.
I created a private key using openssl.
byte[] privateKey=null;
using(Stream stream=new
FileStream("rsa.private"))
{
privateKeys=new byte[stream.Length];

stream.Read(privateKeys,0,privateKeys.Length);
}
DomainKeys dk=new DomainKeys();
smtpObject.Message=dk.Sign(message,null,privat
eKeys,"dk");

I get an exception:
"Invalid cryptographic private key format."

What's happening ?

Thanks by advance for your help.
Back to Top View jing.wang's Profile Search for other posts by jing.wang
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6094
Posted: 22 October 2009 at 3:53am | IP Logged Quote Igor

You're sending base64-encoded data to method which expects decoded (binary) data. Try using different overload for this, you may either read from filestream or specify a filename, be sure to set isFilename property accordingly.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide