|
|
Does any know of a way in C# to contact a web server and get the public SSL certificate information? I know all of this is handled by web service calls over https but I need the certificate to do some offline processing outside of webservices.
Any help would be greatly appreciated.
~Nick
Forever Developing
|
|
|
|
|
Take a look at the System.Security namespace
led mike
|
|
|
|
|
That namespace is used for code access security. I am interested in Public Key Encryption. I am look for a way to contact a web server and have it transmit me its public key.
~Nick
Forever Developing
|
|
|
|
|
Sorry, I fat fingered it.
System.Net.Security
led mike
|
|
|
|
|
led mike,
Thank for the information but I am not using sockets or streams. I have a set of files that are digitally signed and I want to make sure their signatures are valid. After getting the files and the digital signatures I need the URL's public key to validate the Signatures.
Using Fiddler I noticed the following response on a 443 connect. However, I am not sure how this would translate to x509 certificate in C# code.
~Nick
HTTP/1.1 200 Connection Established
This is a HTTPS CONNECT Tunnel. Secure traffic flows through this connection.
Secure Protocol: Tls
Cipher: Rc4 128bits
Hash Algorithm: Md5 128bits
Key Exchange: RsaSign 1024bits
Certificate:
[Subject]
CN=www.intellicheck.com, OU=Secure Link SSL, OU=Data Systems, O="Intelli-Check, Inc.", STREET=246 Crossways Park West, L=Woodbury, S=NY, PostalCode=11797, C=US
[Issuer]
CN=Network Solutions Certificate Authority, O=Network Solutions L.L.C., C=US
[Serial Number]
00F36126851351E1E58CD16C5DA38A430C
[Not Before]
9/5/2005 8:00:00 PM
[Not After]
9/5/2008 7:59:59 PM
[Thumbprint]
BAF241B7E84E5663AE70D7470076EF1D0CAEF222
Forever Developing
|
|
|
|
|
Hi Everybody,
I'm getting DllNotFoundException when trying to execute some code, and I'm lost as to what's happening. Anyways, here's what I've got:
1. I wrote some code on machine A that consists of a C++ dll which interfaces with an external library (lib files for MATLAB). I set the include search path to include the directory that those files are in on machine A.
2. I wrote some C# code on the same machine to access that dll using:
[DllImport("savemat.dll")]
static extern void SaveData(string filename, string colname, double[] data, int length);
3. When I run the code on machine A, everything works fine, but on any other machine I get a DllNotFoundException.
I'm assuming that this is coming from interop not being able to load the MATLAB lib files that I use in the dll. I tried putting copies of those files in the same location on other machines, but that doesn't work. I also tried having those .lib files in the execution directory.
I hope this is a clear enough description of my problem and that somebody can help.
Thanks,
Nick
p.s. Yes, I definitely do have savemat.dll in the execution directory
|
|
|
|
|
Is this a dll that needs to be registered with regsvcr ? Some dlls need to be registered for them to be visible to other applications.
Hope that helps.
Ben
|
|
|
|
|
I don't think it needs to be registered since it worked fine on the initial development machine without being registered. I just tried it anyways, and it says: LoadLibrary("savemat.dll") failed - The specified module could not be found.
Also, I forgot to mention that I wrote an additional dll that doesn't call into any external code (just a hello, world), and that works fine on all machines.
|
|
|
|
|
Run depends on it and see what DLL it can't find.
[My bad, didn't realize that this was the C# forum. Depends might not work on .NET assemblies]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
I tried putting the dll I wrote into depends, and it's giving me some information, but I don't know what it means. In the tree view on the left hand side, it lists libmat.dll and libmx.dll underneath my savemat.dll, but libmx.dll is red.
In the column view to the right of that, when I click on libmx.dll, one of the functions listed has a red rectangle with a 'C' in it, but I don't know what that means. I looked through the help files, but couldn't really figure anything out.
Also, I don't understand why in depends, it lists things like libmat.dll instead of libmat.lib, which is what I originally linked with in savemat.dll.
|
|
|
|
|
You should start reading about static linking vs. dynamic linking.
When you're using a lib, you're copying the functions your program is using right into the binary.
When you're using a dll, you only include a reference in the application saying "call function number 3 from mysharedlibrary.dll".
In this case the application must be able to find mysharedlibrary.dll at runtime and every dll mysharedlibrary.dll is depending on.
In your case savemat.dll seems to be found but it cannot be loaded because libmx.dll cannot be found.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
That's the thing that's so confusing to me!
I was using libs when I wrote the C++ library, and it seems like they're being copied into savemat.dll, since it's only like 20 lines of code, but it comes out at 220KB.
I'm really confused that depends would have dlls listed as dependencies of my dll since i didn't link to any dlls.
I'll have to double check all of this, so I don't look like a huge idiot...
|
|
|
|
|
heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string :
public void AddSv(Line l , ref string str)
{
if(drawwhat==1)// as one means lines
str +="1"+"\n"+l.First.X.ToString()+"\n"+
l.First.Y.ToString()+"\n"+
l.Second.X.ToString()+"\n"+
l.Second.Y.ToString()+"\n"+
l.Pen.Color.R.ToString()+"\n"+
l.Pen.Color.G.ToString()+"\n"+
l.Pen.Color.B.ToString()+"\n"+
l.Pen.Width.ToString()+"\n\n";
after i draw the line i click on save to send the informations to the text :
private void button1_Click(object sender, System.EventArgs e)
{
//save
System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
StreamWriter streamWriter=new StreamWriter(fs);
streamWriter.WriteLine(LineSv);
streamWriter.Flush();
streamWriter.Close();
fs.Close();
}
Regards;P;
|
|
|
|
|
Don't cross post
only two letters away from being an asset
|
|
|
|
|
mr jets wrote: Now how can i make my prog read from the text
System.Runtime.Serialization
led mike
|
|
|
|
|
thanks..but iam looking for the idea to make it reads line by line and draw the line ..should i use split fuction..or if condition..iam LOST!!
|
|
|
|
|
I know this so far...I must use using System.Runtime.InteropServices; Also, I must say the form class is COM visible like this [ComVisible(true)] .
What I don't understand is how I can call the javascript functions once I have done that. I tried this:
string path = Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "VirtualEarth.htm");
webBrowser1.Navigate(path);
webBrowser1.Document.InvokeScript("loadMap()");
webBrowser1.Document.InvokeScript("goto_map_position(43.22, 45.56)");
However, all it does it load the intial page. It doesn't appear that the javascript function calls are working. Can anyone provide an example of how to do this.
Many thanks,
chance.
|
|
|
|
|
|
I must be doing something wrong, cuz I am testing out some this mechanism and I make a simple call to a Javascript function like this:
string path = Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "VirtualEarth.htm");
webBrowser1.Navigate(path);
webBrowser1.Document.InvokeScript("doSomething");
function doSomething()
{
MsgBox("you suck");
map.HideDashboard();
}
Nothing happens.
|
|
|
|
|
What does mean 'Internal' and 'Protected Internal' for a class.
Durgesh Kumar Mishra
|
|
|
|
|
Internal means the type is only accessible from within the assembly it is defined in.
Protected Internal is simply a combination of the two class modifiers. We know that "internal" means the type can only be accessed from withing the assembly it is defined in. And we know that "protected" means it can only be accessed by the containing class or classed derived from the containing class. So, protected internal means the type can only be accessed by the containing class and derived classes that are included in the same assembly.
-- modified at 13:32 Thursday 17th May, 2007
|
|
|
|
|
protected internal means that the member can be accessed from the current assembly *or* derived classes (both conditions do not need to be true).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# to C++/CLI and VB to C++/CLI
Instant Python: converts C# to IronPython and VB to IronPython
|
|
|
|
|
Ah. Right you are. My mistake.
Thanks!
Ian
Ian
|
|
|
|
|
Hi,
Modifier internal means that we can only access that class from the same assembly.
"protected internal" cannot be applied on class. But it can be applied on members. This means two things. It is either derived classes or classes in the same file that can access that member.
Manoj
|
|
|
|