将多个证书存储在LDAP服务器中(1.3.6.1.4.1.1466.115.121.1.8_Certificate) [英] Store mmultiple certificates in LDAP server in (1.3.6.1.4.1.1466.115.121.1.8_Certificate)

查看:72
本文介绍了将多个证书存储在LDAP服务器中(1.3.6.1.4.1.1466.115.121.1.8_Certificate)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想使用c#代码在LDAP服务器上传多个证书。我有代码来读取多个证书字节,但我无法存储多个证书。


请问我如何将数据传递到LDAP服务器以存储多个证书用于从ldap服务器读取数据的代码。


string test =" LDAP://" + ldapserver +" /" + ldapbasedn;

using(DirectoryEntry entry = new DirectoryEntry(" LDAP://" + ldapserver +" /" + ldapbasedn,ldapuser,ldappassword,AuthenticationTypes.None))

{

DirectorySearcher ds = new DirectorySearcher(entry);

ds.SearchScope = SearchScope.Subtree;

// ds.Filter = string.Format(ldapfilter,user);

SearchResultCollection result = ds.FindAll();

int i = 0;

foreach(结果中的SearchResult r)

{

// string s = r.Properties [" objectClass"] [i] .ToString();

// string s1 = r.Properties [" adspath"] [i] .ToString();

// string s2 = r.Properties [" dc"] [i] .ToString();

if(r.Properties.Contains(" usercertificate; binary"))

{





字节[] b =(字节[])r.Properties [" usercertificate; binary"] [i];

}

}

解决方案


谢谢你可以在这里发帖。


根据我的搜索,我只找到有关如何在C#中添加不能执行此操作的证书的TechNet文档。


https: //support.microsoft.com/en-us/help/321051/how-to-enable-ldap-over-ssl-with-a-third-party-certification-authority


我会继续搜索,如果我有新的东西。我会反馈。


最好的问候,


Wendy



Hi,

I want to upload the multiple certificate in LDAP server using c# code. I have the code to read the multple certificatre bytes but I am not able to store the multple certificates.

Could you help me please how I pass the data to LDAP server for storing the multiple certificate bytes.

Code for reading the data from ldap server.

string test = "LDAP://" + ldapserver + "/" + ldapbasedn;
using (DirectoryEntry entry = new DirectoryEntry("LDAP://" + ldapserver + "/" + ldapbasedn, ldapuser, ldappassword, AuthenticationTypes.None))
{
DirectorySearcher ds = new DirectorySearcher(entry);
ds.SearchScope = SearchScope.Subtree;
//ds.Filter = string.Format(ldapfilter, user);
SearchResultCollection result = ds.FindAll();
int i = 0;
foreach (SearchResult r in result)
{
//string s = r.Properties["objectClass"][i].ToString();
//string s1 = r.Properties["adspath"][i].ToString();
//string s2 = r.Properties["dc"][i].ToString();
if (r.Properties.Contains("usercertificate;binary"))
{


Byte[] b = (Byte[])r.Properties["usercertificate;binary"][i];
}
}

解决方案

Hi,

Thank you for posting here.

Based on my search, I only find the TechNet document about how to add certificates which not do this in C#.

https://support.microsoft.com/en-us/help/321051/how-to-enable-ldap-over-ssl-with-a-third-party-certification-authority

I will keep on search, if I have something new. I will feedback.

Best Regards,

Wendy


这篇关于将多个证书存储在LDAP服务器中(1.3.6.1.4.1.1466.115.121.1.8_Certificate)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆