use a String.Split() with comma...then you get array....and display them in label controls...
but if you want that to be generated by the PKCS library itself, then you might need to post the same question in that thrid party library support forums...
use a String.Split() with comma...then you get array....and display them in label controls...
but if you want that to be generated by the PKCS library itself, then you might need to post the same question in that thrid party library support forums...
use a String.Split() with comma...then you get array....and display them in label controls...
but if you want that to be generated by the PKCS library itself, then you might need to post the same question in that thrid party library support forums...
thanks,
this library is from microsoft
i give it a tried
thank you
look2bar
ramiramilu
look2bar
it show CN=test.com,OU=test,O=test,C=GB
use a String.Split() with comma...then you get array....and display them in label controls...
but if you want that to be generated by the PKCS library itself, then you might need to post the same question in that thrid party library support forums...
look2bar
Member
240 Points
292 Posts
Decode CSR Problem
Apr 26, 2012 10:12 AM|LINK
This is the code to decoder a csr (pkcs10 request) but the problem is
it show CN=test.com,OU=test,O=test,C=GB but i want the make it like this
CN= label1
OU= Label2
O= Label3
C= Label4
Import (Using CERTENROLLLib;) CertEnroll library
thank you
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 27, 2012 06:35 AM|LINK
ramiramilu
All-Star
98063 Points
14516 Posts
Re: Decode CSR Problem
Apr 27, 2012 07:37 AM|LINK
use a String.Split() with comma...then you get array....and display them in label controls...
but if you want that to be generated by the PKCS library itself, then you might need to post the same question in that thrid party library support forums...
thanks,
JumpStart
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 27, 2012 07:54 AM|LINK
this library is from microsoft
i give it a tried
thank you
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 27, 2012 07:59 AM|LINK
hello
can you write some code with String.Split()
please
thank you
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 27, 2012 09:45 AM|LINK
my code
i tried the string[] array but it did not work
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" Height="202px" TextMode="MultiLine" Width="610px"></asp:TextBox> <br /> <br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <br /> <br /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label5" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label6" runat="server" Text="Label"></asp:Label> </div> </form> </body> </html>Default.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CERTENROLLLib; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string csr = TextBox1.Text; CX509CertificateRequestPkcs10 request = new CX509CertificateRequestPkcs10(); request.InitializeDecode(csr, EncodingType.XCN_CRYPT_STRING_BASE64_ANY); request.CheckSignature(); Label4.Text = (((CX500DistinguishedName)request.Subject).Name); string[] CSRInformation = new string[] {(((CX500DistinguishedName)request.Subject).Name)}; Label1.Text = CSRInformation[0]; } }thank you
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 28, 2012 07:37 AM|LINK
i tried String.Split() but not working the code from last post right
ramiramilu
All-Star
98063 Points
14516 Posts
Re: Decode CSR Problem
Apr 28, 2012 09:56 AM|LINK
this is your code -
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { string str = "CN=test.com,OU=test,O=test,C=GB"; string[] s = str.Split(new char[] { ',' }); Label1.Text = s[0]; Label2.Text = s[1]; Label3.Text = s[2]; Label4.Text = s[3]; } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label> </div> </form> </body> </html>JumpStart
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 28, 2012 11:21 AM|LINK
can you add this code in thyour code
string csr = TextBox1.Text;
CX509CertificateRequestPkcs10 request = new CX509CertificateRequestPkcs10();
request.InitializeDecode(csr, EncodingType.XCN_CRYPT_STRING_BASE64_ANY);
request.CheckSignature();
Label4.Text = (((CX500DistinguishedName)request.Subject).Name);
string[] CSRInformation = new string[] {(((CX500DistinguishedName)request.Subject).Name)};
look2bar
Member
240 Points
292 Posts
Re: Decode CSR Problem
Apr 28, 2012 06:14 PM|LINK
thank you for you help