EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Help me!

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#5385
Posted: 03/13/2008 02:18:53
by  xu cong
I want to use ASP.NET (C#) to read the detailed information in CSR file,
could you tell me and use what method it is in SecureBlackbox?

Thank you very much!
#5387
Posted: 03/13/2008 02:23:46
by Ken Ivanov (EldoS Corp.)

Thank you for your interest in our products.

Please consider using INSTALLDIR\Samples\C#\PKIBlackbox\CertReqDemo sample as a guide.
#5390
Posted: 03/13/2008 02:35:06
by  xu cong
Thank you!
I have seen that example, but what I wondered is how to obtain the information in CSR.
For example:
Input:
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIB1jCCAT8CAQAwgZUxCzAJBgNVBAYTAmNuMREwDwYDVQQIEwhzaGFuZ2hhaTER
MA8GA1UEBxMIc2hhbmdoYWkxDzANBgNVBAoTBnl1bGlhbjETMBEGA1UECxMKUHJv
Z3JhbW1lcjEVMBMGA1UEAxMMd3d3LmNvbmcuY29tMSMwIQYJKoZIhvcNAQkBFhRp
bnRlcm5ldF84MThAMTYzLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
55x97o5dNMq36lFRHZQanPQcgyOl8xilqqrNsLr9sHmMr9ZSjYg++u12LJrBqCN8
g+d6haNAPlXXYppEzsXvUNUd0HZZz7Q2945V+peNH9qisjiFVGOSrZ7mgHfAbrG7
dDhbhF3FQ9GNbg2Pcg1ieSIxYaeSfv9Ws9ERhDyeUqcCAwEAAaAAMA0GCSqGSIb3
DQEBBQUAA4GBAN2xWiUeis/DcYtrQ5i7YqSV9u0OO8nJI9MEmnbgDIOoIYxEJg2D
t67mZOCXsT9ycDt30ck5Z0iU78jUckUSaBWqyZLaPGJhf1QKN9thbrzuqCYNRHRf
F/QFGZK0GastNKRVrs7O6hhfX6wLMAe8LBB5deItLxrgzrMlGQKn1AJM
-----END NEW CERTIFICATE REQUEST-----


return:
CSR=/C=cn/ST=shanghai/L=shanghai/O=yulian/OU=Programmer/CN=www.cong.com/emailAddress=internet_818@163.com
C=cn
ST=shanghai
L=shanghai
O=yulian
OU=Programmer
CN=www.cong.com
emailAddress=internet_818@163.com
#5394
Posted: 03/13/2008 03:39:37
by Ken Ivanov (EldoS Corp.)

First, you should load the request into TElCertificateRequest object using one of the LoadFrom* methods. The information you have mentioned (i.e., the credentials of request creator) can be accessed via TElCertificateRequest.Subject property.
#5398
Posted: 03/13/2008 06:41:30
by  xu cong
protected TElCertificateRequest FRequest = new TElCertificateRequest();

Byte[] StrPem;
string CSR = "-----BEGIN NEW CERTIFICATE REQUEST-----MIIBkjCB/AIBA...iFhy/M3l0drIRYXshWLqh5VWMEFb/AanYs9q6ooMfyeH2IfaVIwAfiBmuwc8ttrtvamXDo+CwFy...BqTi/aRrC...b0sn+FrGFQy1B8c+XToa9CYxS3p4btb5/XUAOtqG7RsrPf+qJ5FqnrI15DknQkYyA==-----END NEW CERTIFICATE REQUEST-----";

FRequest.Subject.Clear();
FRequest.SaveToBufferPEM(out StrPem);
FRequest.LoadFromBufferPEM(StrPem);
TextBox3.Text = SBUtils.Unit.UTF8ToStr(FRequest.Subject.get_Values(0));



The above is my code. I do not know why, act as and carry out it to FRequest.LoadFromBufferPEM (StrPem); Always present “EElCertificateRequestExceptione: Invalid PEM data”.
#5399
Posted: 03/13/2008 06:55:09
by Ken Ivanov (EldoS Corp.)

That's because you are passing PEM data as a [long] single line (i.e., newline characters are not preserved). Please pass the request in its original form (the one you have posted in your second message).
#5418
Posted: 03/13/2008 20:35:12
by  xu cong
Your meaning is my grammar does not have the mistake? But I am have tested according to yours request, you meaning i have nothing wrong with my grammar?
#5422
Posted: 03/14/2008 00:32:01
by Eugene Mayevski (EldoS Corp.)

Our sample request has 11 lines of text, and you have put all eleven lines in one text line. The component can't parse your data.


Sincerely yours
Eugene Mayevski
#5423
Posted: 03/14/2008 01:09:48
by  xu cong
I knew, but I use his original form test, the result appears “EElCertificateRequestExc­eptione: Invalid PEM data”.
#5436
Posted: 03/14/2008 11:34:40
by Ken Ivanov (EldoS Corp.)

We are really sorry, but the distribution available on the site contains a problem that prevents base64-enveloped data from being loaded correctly. We are working on the fix at the moment in order to update the distribution ASAP.

Certificate requests in binary form can be loaded correctly though.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 4599 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!