|
Hi we are trying to make a GET request against a REST API of a partner company.
In collaboration with the partner company we have produced the necessary ingredients, but we don't know how to put them together?
This is what we have:
- URL: The URL of the partner REST API
- PRIVATE KEY: privateKey.key
- CERTIFICATE: certificate.pem
- PASSWORD: We have defined some passwords.
We have tried to open the .key and the .pem files with Notepad, and the text there is readable, and goes like:
privateKey.key:
-----BEGIN PRIVATE KEY-----
MIIEvAIBA
(...)
6xz6tGWWdkR4uw==
-----END PRIVATE KEY-----
certificate.pem
-----BEGIN CERTIFICATE-----
MIIEbDCCA (...)
QmliDutXh/BjT0=
-----END CERTIFICATE-----
We are wondering how to make a REST request with these things in C#?
We have been wondering if the PRIVATE KEY and the CERTIFICATE should be converted into another file?
So with OpenSSL, running the command below, we tried to convert those two files into a .pfx file:
openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt
The resulting .pfx file was not human readable, it was like: " ‚h‚d0‚`0‚ *†H†÷ (...)".
To make the REST GET request is it then necessary to install the certificate?
As you may understand from this post we are quite ignorant on the subject of making a request with certificate, private key and password in C#, looking for some help.
There are many questions and we actually don't know exactly what to do.
|
|
|
|
|
Hey, i am making a program, in which i have load an image in picturebox1. now i want to reduce image size and pixels and want to display in picturebox2.
so how can i do this?
|
|
|
|
|
You could start by not reposting the same lack-of-a-question!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Are you trying to reduce the image size and save it? Or reduce it on screen? Please, try to explain in as much detail as you can!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Simple one...
0. Click your picturebox (I asssume this has the image?)
1. At the right side of the screen, you will the properties tab.
2. Kindly search for "Size Mode" property on the properties tab.
3. There, you can change the image if you want the Normal size, Stretch image, AutoSize, Center Image or Zoom.
Don't mind those people who say you're not HOT. At least you know you're COOL.
I'm not afraid of falling, I'm afraid of the sudden stop at the end of the fall! - Richard Andrew x64
|
|
|
|
|
It's only a simple one if that is what he's actually trying to do. As it is, you're making assumptions. It's always worth seeking clarification if something could have multiple meanings.
|
|
|
|
|
Pete O'Hanlon wrote: As it is, you're making assumptions.
Yes, I am.
But, I also base my answer on how he asks. I think, he won't construct a question like that if he meant a 'complicated' thing for the picturebox.
At least, his not like the others who say 'I need a program for XXX in XXX languange'. He wants to learn, but lacks the 'curiosity' ability on his chosen IDE.
Give them the simplest idea, and if they don't really ask for the 'simplest' one, then at least they know where to start. That is, IMO.
Pete O'Hanlon wrote: It's always worth seeking clarification if something could have multiple meanings.
Agree. I'll do that next time. Thanks Pete.
Don't mind those people who say you're not HOT. At least you know you're COOL.
I'm not afraid of falling, I'm afraid of the sudden stop at the end of the fall! - Richard Andrew x64
|
|
|
|
|
And this[^] says he wants something more complicated.
|
|
|
|
|
Stop reposting your question
Tim Toady Bicarbonate
|
|
|
|
|
Hi All
I am calling a REST API from my C# Console application and get the following error while calling GetResponse method
"The request was aborted: Could not create SSL/TLS secure channel."
The code has worked before couple of days back , so I am not sure what changed. The cert I am using is valid cert installed on my machine where I run the code, I checked the expiration details and all.
My code is as follows, it fails in the try block below.The uri that I pass is this -https://management.core.windows.net/{0}/services/hostedservices[^] I replace the {0} with a valid id ofcourse.
Code:
public static XDocument GetResponse(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.Method = "GET";
request.Headers.Add("x-ms-version", msVersion);
request.ClientCertificates.Add(certificate);
request.ContentType = "application/xml";
XDocument responseBody = null;
HttpWebResponse response;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException ex)
{
response = (HttpWebResponse)ex.Response;
}
}
Exception:
The complete exception is:
System.Net.WebException was caught
HResult=-2146233079
Message=The request was aborted: Could not create SSL/TLS secure channel.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at StorageAccountsExtractor.AzureService.GetResponse(Uri uri) in e:\StorageAccountsRetriever\StorageAccountsExtractor\StorageAccountsExtractor\Program.cs:line 289
InnerException:
Solution:
I looked on the web and looks like I need to make HTTPS use TLS? how do I do that.Any other ideas that I could look into?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
If it was working a couple of days ago it's almost certainly that something has expired, either your SSL certificate, the server's certificate (though that is unlikely if you're using a hosted service), your user name or API key.
|
|
|
|
|
Hi,
This is my own project, I have an idea, but a litle C# knowledge.
I have a (256 * 256) led panel.
Users have a GUI for loading image or drawing graphic.
GUI will convert this image white and black , using WB filter.
An engine will convert white pixel to "0" , black pixel to "1"
Than each of pixel row will send I/0 card as 256 bit message data.
I want to floating image on led panel.
Any source code ?
And which interface is appropriate for this communication. pc and IO card.
Thanks.
|
|
|
|
|
256 x 256 is 64k elements.
If the leds are nothing but on/off then the a 256 byte (not bit) array would suffice.
If there are more options then it would be bigger.
Erkanh wrote: Than each of pixel row will send I/0 card as 256 bit message data.
That almost always depends on the device. Is this an existing device or are you building it?
|
|
|
|
|
We can't tell you - the major problem is that we have no idea how you are connecting the card to the PC so we have not idea how to transfer the info - and there ate LOADS of different ways to connect the hardware.
The minor problem is that we have no idea what else you are stuck on - it could be that you have no idea how to do any of it, but we can't tell.
So give us information on what help you need!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I presume you really mean a 16x16 array of LEDs?
Regards,
Rob Philpott.
|
|
|
|
|
Is it possible controlling number of 255 solenoid valve ?
Like "http://www.youtube.com/watch?v=zQqBJ3nv6Ls"
At the same time I could make on/off solenoid valves ?
Any source code or sample ?
Thanks
|
|
|
|
|
Group Members,
I am new at Lucene.Net and using this in my application
In my application I want to know which field of the Document has been matched during search.
So I opted for searcher.explain(). However later I found out that this is a costly approach.
As an alternative I pondered in contrib dlls and saw FastVectorHighlighter class having IsFieldMatch() api. But there is no documentation available stating if this can be used without any performance constraint.
So kindly let me know which is better searcher.explain() or FastVectorHighlighter.IsFieldMatch()
It will also be great if you people suggest me any alternative approach as well.
Regards,
Shubhanshu
|
|
|
|
|
Don't cross post this everywhere - it duplicates work and that annoys people.
You posted this in QA first, so leave it there and see what happens.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
ok.
My appology for the mistake in the usage of the forum.
I was not aware about it.
Regards,
Shubhanshu
|
|
|
|
|
|
am creating an application (using c#) whereby to one of the processes of the Application is that it has to read ID Card details(name, Image on card and card number) store it in the database (using SQLite) each time a staff wants to take an item from the store. How do I get the application to interpret the data it gets from the card reader and send it to the database, pls help. thanks
|
|
|
|
|
Read the documentation for the card reader device; that is the only way you can find the answer to this question.
|
|
|
|
|
I have a Listbox on Form1. I want on click on Listbox item to display the item name in a TextBox on Form2. How can I do it?
|
|
|
|