在以下範例中,由 -b 選項 (cn=SMIME admin, ou=people,o=demo.siroe.com,o=demo objectclass=*) 定義的基底 DN 說明 LDAP 目錄中的某個 CA 憑證。如果在目錄中找到該憑證,ldapsearch 會將有關該憑證的資訊傳回至 ca-cert.lidf 檔案。
# ldapsearch -L -h demo.siroe.com -D "cn=Directory Manager" -w mypasswd -b "cn=SMIME admin, ou=people,o=demo.siroe.com,o=demo" "objectclass=*" > ca-cert.ldif |
以下範例顯示 ca-cert.ldif 檔案中的搜尋結果。該檔案內容的格式為使用 ldapsearch 的 -L 選項之結果。
# more ca-cert.ldif dn: cn=SMIME admin,ou=people,o=demo.siroe.com,o=demo objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: certificationAuthority cn: RootCACerts cn: SMIME admin sn: CA authorityRevocationList: novalue certificateRevocationList: novalue cacertificate;binary:: MFU01JTUUxEjAQBgNVBAsTCU1zZNlcnZlcjcMBoGA1UEAxMTydG QGEwJVEOMAwGA1UEChMFU0UUxEjAQBgNVBAsTCU1zZ1NlcnZlcjEcMBoGA1UEAxMTQ2VydG aFw0jAxMTIwODAwMDBaM267X9FExCzAJBgwyrjgNVBAk9STklBMQwwCgYDVQQVHR8EgaQwg YlVzMRMwEQYDVQQIEwpDQUx9STklBMQwwCgYDVQQKEwww3ltgoOYz11lzAdBgNVBpYSE9Vc 5yQuaddiiWlm899XBsYW5ljb20wgZ8wDQYJoGBAK1mUTy8vvO2nOFg4mlHjkghytQUR1k8l 5mcWRfL77ntm5mGXRD3XMciUq6zUfIg3ngvxlLKLyERTIqjUS8HQU4R5pvj+rrVgsAGjggE +FNAJmqtOV2A3wMyghqkDP3Aqq2BYfkcn4va3C5nRNAYxNNVE84JJ0H3jyPDXhMBlQU6vQn 1NABAAGjggEXMIIBEzglghkgBhvhCAQEEBApqlSai4mfuvjh02SQkoPMNDAgTwMB8GA1UdI QYMAFEd38IK05AHreOYc6v+ENMOwZMIGsBgNVHR8EgaQwgaEwb6BtoGuGaWxkYXA6Lyht74 tpbucmVkLmlwbGFuZY29tL1VJRD1DZXJ0aWZpY2F0ZSBNYW5hZ2VyLE9VPVBlb3BsZSxPPW 1haWYT9jZXJ0aWZpdu2medXRllHjkghytQURYFNrkuoCygKoYoaHR0cDovL3Bla2kghytQU luZyZWQuaXBsYW5ldb20vcGVraW5nLmNybDAeBgNVHREEFzAVgRNwb3J0aWEuc2hhb0BzdW 4uYtMA0GCxLm78Ufre3Pp078jyTaDv2ci1AudBL8+RrRUQvxsMJfZeFED+Uuf10Ilt6kwhm Tc6W5UekbirfEZGAVQIzlt6DQJfgpifGLvtQ60Kw== |
在以下範例中,由 -b 選項 (o=demo.siroe.com,o=demo objectclass=*) 定義的基底 DN 為在 LDAP 目錄中基底 DN 中和之下找到的、且傳回至檔案 usergroup.ldif 的所有公開金鑰和憑證之基底 DN︰
# ldapsearch -L -h demo.siroe.com -D "cn=Directory Manager" -w mypasswd -b "o=demo.siroe.com,o=demo" "objectclass=*" > usergroup.ldif |
在以下範例中,由 -b 選項 (uid=JohnDoe, ou=people,o=demo.siroe.com,o=demo objectclass=*) 定義的基底 DN說明 LDAP 目錄中的某個公開金鑰和其憑證。
# ldapsearch -L -h demo.siroe.com -D "cn=Directory Manager" -w mypasswd -b "uid=JohnDoe, ou=people,o=demo.siroe.com,o=demo" "objectclass=*" > public-key.ldif |
以下範例顯示 public-key.ldif 檔案中的搜尋結果。該檔案內容的格式為使用 ldapsearch 的 -L 選項之結果。
# more public-key.ldif dn: uid=sdemo1, ou=people, o=demo.siroe.com, o=demo objectClass: top objectClass: person objectClass: organizationalPerson objectClass: siroe-am-managed-person objectClass: inetOrgPerson objectClass: inetUser objectClass: ipUser objectClass: userPresenceProfile objectClass: inetMailUser objectClass: inetLocalMailRecipient objectClass: icsCalendarUser objectClass: sunUCPreferences mail: JohnDoe@demo.siroe.com mailHost: demo.siroe.com . . uid: JohnDoe . . mailUserStatus: active inetUserStatus: active . . usercertificate;binary:: MFU01JTUUxEjAQBgNBAsTCU1zZ1NlcnZjcMBoGA1UEAxMTydG QGEwJEOwGA1UEChMFU01JTUUxEjAQBgNVBAsTCU1zZ1NlcnZlcjEcMBoGA1UEAxMTQ2VydG aFw0MTIwODAwMDBaM267hgbX9FExCzAJBgwyrjgNVBAk9STklBMQwwCgYDVQQVHR8EgaQwg YTAlVEQYDVQQIEwpDQUxJRk9STklBMQwwCgYDVQQKEwww3ltgoOYz11lzAdBgNVBpYSE9Vc 5yZWQdWlm899XBsYW5ldC5jb20wgZ8wDQYJoGBAK1mUTy8vvO2nOFg4mlHjkghytQUR1k8l 5mvgc7ntm5mGXRD3XMU4OciUq6zUfIg3ngvxlLKLyERTIqjUS8HQU4R5pvj+rrVgsAGjggE +FG9NmV2A3wMyghqkVPNDP3Aqq2BYfkcn4va3C5nRNAYxNNVE84JJ0H3jyPDXhMBlQU6vQn 1NAgMAgEXMIIBEzARBglghkgBhvhCAQEEBApqlSai4mfuvjh02SQkoPMNDAgTwMB8GA1UdI QYMBaEdK05AHreiU9OYc6v+ENMOwZMIGsBgNVHR8EgaQwgaEwb6BtoGuGaWxkYXA6Lyht74 tpbucmVkwbGFuZXQuY29tL1VJRD1DZXJ0aWZpY2F0ZSBNYW5hZ2VyLE9VPVBlb3BsZSxPPW 1haxYT9jZaWZpY2jdu2medXRllHjkghytQURYFNrkuoCygKoYoaHR0cDovL3Bla2kghytQU luZyZWQuaYW5ldC5jb20vcGVraW5nLmNybDAeBgNVHREEFzAVgRNwb3J0aWEuc2hhb0BzdW 4u9tMA0GC78UfreCxS3Pp078jyTaDv2ci1AudBL8+RrRUQvxsMJfZeFED+Uuf10Ilt6kwhm Tc6W5UekbirfEZGAVQIzlt6DQJfgpifGLvtQ60Kw== . . |