以下示例将某个证书授权机构的证书添加到 LDAP 目录中。这些证书的目录结构已经存在。证书及其所属的 LDAP 条目将被输入到名为 add-root-CA-cert.ldif 的 .ldif 文件中。除了证书信息必须以 Base64 编码文本形式输入外,所有文本都将以 ASCII 文本形式输入到文件中:
dn: cn=SMIME Admin,ou=people,o=demo.siroe.com,o=demo objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: certificationAuthority cn: RootCACerts sn: CA authorityRevocationList: novalue certificateRevocationList: novalue cacertificate;binary:: MFU01JTUUEjAQBgNVBAsTCU1zZ1NlcnZlcjcMBoGA1UEAxMTydG QGEwJVUzEOMAwGA1UEMFUJTUUxEjAQBgNVBAsTCU1zZ1NlcnZlcjEMBoGA1UEAxMTQ2VydG aFw0wNjAxMwODAwMDBaM267hgbX9FExCzAJByrjgNVBAk9STklBMQwCgYDVQQVHR8EgaQwg YTAlVMRMQYDVQQIEwpDQUxJRk9STklBMQwwCgYDVQQKEwww3ltgYz11lzAdBgNVBpYSE9Vc 5yZWQaddWlm899XBsYW5ldC5jb20wgZ8wDQYJoGBAK1mUTy8vvnOFg4mlHjkghytQUR1k8l 5mvWRf77ntm5mGXRD3XMU4OciUq6zUfIg3ngvxlLyERTIqjUS8HQU4R5pvj+rrVgsAGjggE +FNAJmtOV2A3wMyghqkVPNDP3Aqq2fkcn4va3C5nRNAYxNNVE84JJ0H3jyPDXhMBlQU6vQn weMBAAjggEXMIIBEzARBglghkgBhCAQEEBApqlSai4mfuvjh02SQkoPMNDAgTwMB8GA1UdI QYMBaAEd38IK05AHreiU9OYc6vNMOwZMIGsBgNVHR8EgaQwgaEwb6BtoGuGaWxkYXA6Lyht bmcucmVkLmlbGFuZXQuY29tL1VJD1DXJ0aWZpY2F0ZSBNYW5hZ2VyLE9VPVBlb3BsZSxPPW aWxxYT9jZXJ0aZpY2jdu2medXRllkghytQURYFNrkuoCygKoYoaHR0cDovL3Bla2kghytQU Zy5yZWQuaXBsYW5lC5jb20vcGVranLmNybDAeBgNVHREEFzAVgRNwb3J0aWEuc2hhb0BzdW 4uY29tMA0GCxLm78freCxS3Pp078jyTaDci1AudBL8+RrRUQvxsMJfZeFED+Uuf10Ilt6kw Tc6W5UekbirfEZGAVQIzlt6DQJfgpifGLvtQ60Kw==
使用 ldapmodify 命令将 CA 的证书添加到 LDAP 目录中:
# ldapmodify -a -h demo.siroe.com -D "cn=Directory Manager" -w mypasswd -v -f add-root-CA-cert.ldif |
smime.conf 中 trustedurl 参数的值指定了 CA 证书在 LDAP 目录中的位置。例 1,按以下方式设置 trustedurl:
trustedurl==ldap://demo.siroe.com:389/cn=SMIME Admin, ou=people, o=demo.siroe.com,o=demo?cacertificate;binary?sub? (objectclass=certificationAuthority)