% ldapsearch -H ldaps://pub-ldap.itc.nagoya-u.ac.jp:1025 \ -b o=ldap-test "(objectclass=*)" -H ldapspubldap.itc.nagoya-u.ac.jp1025 -H ldap://pub-ldap.



Similar documents
Microsoft Word - keisankigairon.ch doc

r1.dvi

K227 Java 2

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

IE6 2 BMI chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chap

: : : TSTank 2

I java A

8 if switch for while do while 2

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

Javaセキュアコーディングセミナー東京 第4回 メソッドとセキュリティ 演習解説

明解Java入門編

オブジェクト脳のつくり方

10K pdf

新・明解Java入門

226

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

Java updated

目 次 Java GUI 3 1 概要 クラス構成 ソースコード例 課題...7 i

-34-

ALG2012-F.ppt

JavaプログラミングⅠ

オブジェクト指向プログラミング・同演習 5月21日演習課題


(Eclipse\202\305\212w\202\324Java2\215\374.pdf)

text_08.dvi

アルゴリズムとデータ構造1

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def

ex01.dvi

明解Javaによるアルゴリズムとデータ構造

コンピュータ中級B ~Javaプログラミング~ 第3回 コンピュータと情報をやりとりするには?

ALG2012-A.ppt

Prog2_9th

I HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi

解答上の注意 1 解答は 解答 紙の問題番号に対応した解答欄にマークしなさい 2 選択肢は 問ごとに 意されています 問 1の選択肢は 問 2で使 しません 3 選択肢は量が多いため 探しやすさの観点よりグループ分けされています グループ分けに合わせて解答欄が区切られていますが 横 1 列で問題 1

明解Javaによるアルゴリズムとデータ構造

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

アプレットの作成

break 文 switch ブロック内の実行中の処理を強制的に終了し ブロックから抜けます switch(i) 強制終了 ソースコード例ソースファイル名 :Sample7_1.java // 入力値の判定 import java.io.*; class Sample7_1 public stati

WebLogic File Services ユーザーズ ガイド


Java言語 第1回

橡Taro9-生徒の活動.PDF

<4D F736F F D2091E F196E291E889F090E C4816A82CC838C E646F6378>

JAVA 11.4 PrintWriter 11.5

Vector Vector Vector Vector() Vector(int n) n Vector(int n,int delta) n delta

問題1 以下に示すプログラムは、次の処理をするプログラムである

文字列操作と正規表現

Java学習教材

Javaセキュアコーディングセミナー2013東京第1回 演習の解説

Java講座

untitled

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

file.book

ALG2012-C.ppt

2 static final int DO NOTHING ON CLOSE static final int HIDE ON CLOSE static final int DISPOSE ON CLOSE static final int EXIT ON CLOSE void setvisible

新・明解Javaで学ぶアルゴリズムとデータ構造

Transcription:

% ldapsearch -H ldaps://pub-ldap.itc.nagoya-u.ac.jp:1025 \ -b o=ldap-test "(objectclass=*)" -H ldapspubldap.itc.nagoya-u.ac.jp1025 -H ldap://pub-ldap.itc.nagoya-u.ac.jp:1024 -Z -ZZ

% ldapsearch -Z -h pub-ldap.itc.nagoya-u.ac.jp -p 1024 \ -b o=ldap-test "(objectclass=*)" % ldapsearch -ZZ -h pub-ldap.itc.nagoya-u.ac.jp -p 1024 \ -b o=ldap-test "(objectclass=*)" ldap_start_tls: Connect error (91) additional info: error:24064064:random number generator: SSLEAY_RAND_BYTES:PRNG not seeded SSLEAY_RAND_BYTES ıb ıb LDAPTLS_REQCERT never % setenv LDAPTLS_REQCERT never TLS_REQCERT never % ps -edalf > ~ /.rnd

env.put(context.provider_url, "ldap://" + host + ":" + port ); % javac ldapsearchssl.java % java ldapsearchssl pub-ldap.itc.nagoya-u.ac.jp 1025 o=ldap-test \ cn=dptstaff,ou=staff,o=ldap-test ps00002 "cn=*" ~ /.keystore ~ import javax.naming.*; import javax.naming.directory.*; import java.util.hashtable; import java.util.enumeration; public class ldapsearchssl { public static void main(string[] args) { if (args.length!= 7 ){ System.out.println( "usage: ldapsearch host port BaseDN BindDN BindPW filter Keystore"); System.exit(0); String host = args[0];

String port = args[1]; String BaseDN = args[2]; String BindDN = args[3]; String BindPW = args[4]; String Filter = args[5]; String Keystore = args[6]; // JSSE java.security.security.addprovider(new com.sun.net.ssl.internal.ssl.provider()); // System.setProperty("javax.net.ssl.trustStore", Keystore); Hashtable env = new Hashtable(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); // TLS env.put(context.security_protocol, "ssl"); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://" + host + ":" + port ); env.put(javax.naming.context.security_authentication, "simple"); env.put(javax.naming.context.security_principal, BindDN ); env.put(javax.naming.context.security_credentials, BindPW); try { DirContext ctx = new InitialDirContext(env); //

import javax.naming.*; import javax.naming.directory.*; import javax.naming.ldap.*; import javax.net.ssl.*; import java.util.hashtable; import java.util.enumeration; import java.io.ioexception; public class ldapsearchstarttls { public static void main(string[] args) { if (args.length!= 7 ){ System.out.println( "usage: ldapsearch host port BaseDN BindDN BindPW filter Keystore"); System.exit(0); String host = args[0]; String port = args[1]; String BaseDN = args[2]; String BindDN = args[3]; String BindPW = args[4]; String Filter = args[5]; String Keystore = args[6]; // JSSE java.security.security.addprovider(new com.sun.net.ssl.internal.ssl.provider()); // System.setProperty("javax.net.ssl.trustStore", Keystore); Hashtable env = new Hashtable(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://" + host + ":" + port ); env.put(javax.naming.context.security_authentication, "simple"); env.put(javax.naming.context.security_principal, BindDN ); env.put(javax.naming.context.security_credentials, BindPW); try { LdapContext ctx = new InitialLdapContext(env, null);

// Perform a StartTLS extended operation StartTlsResponse tls = (StartTlsResponse) ctx.extendedoperation(new StartTlsRequest()); try { SSLSession session = tls.negotiate(); catch(ioexception e) { System.out.println("JNDI Error: "+ e.tostring()); import com.novell.ldap.ldapattribute; import com.novell.ldap.ldapattributeset; import com.novell.ldap.ldapconnection; import com.novell.ldap.ldapentry; import com.novell.ldap.ldapexception; import com.novell.ldap.ldapsearchresults; import com.novell.ldap.util.base64; import java.util.enumeration; import java.util.iterator; import java.io.unsupportedencodingexception; public class ldapsearchssl { public static void main(string[] args) { if (args.length!= 7 ){

System.out.println( "usage: ldapsearch host port BaseDN BindDN BindPW filter Keystore"); System.exit(0); String host = args[0]; int port = Integer.parseInt(args[1]); String BaseDN = args[2]; String BindDN = args[3]; String BindPW = args[4]; String Filter = args[5]; String Keystore = args[6]; // JSSE java.security.security.addprovider(new com.sun.net.ssl.internal.ssl.provider()); // System.setProperty("javax.net.ssl.trustStore", Keystore); // LDAPS LDAPConnection ld = new LDAPConnection(new com.novell.ldap.ldapjssesecuresocketfactory()); LDAPConnection import com.novell.ldap.ldapattribute; import com.novell.ldap.ldapattributeset; import com.novell.ldap.ldapconnection; import com.novell.ldap.ldapentry;

import com.novell.ldap.ldapexception; import com.novell.ldap.ldapsearchresults; import com.novell.ldap.util.base64; import java.util.enumeration; import java.util.iterator; import java.io.unsupportedencodingexception; public class ldapsearchstarttls { public static void main(string[] args) { if (args.length!= 7 ){ System.out.println( "usage: ldapsearch host port BaseDN BindDN BindPW filter Keystore"); System.exit(0); String host = args[0]; int port = Integer.parseInt(args[1]); String BaseDN = args[2]; String BindDN = args[3]; String BindPW = args[4]; String Filter = args[5]; String Keystore = args[6]; // JSSE java.security.security.addprovider(new com.sun.net.ssl.internal.ssl.provider()); // System.setProperty("javax.net.ssl.trustStore", Keystore); // Start TLS LDAPConnection ld = new LDAPConnection(new com.novell.ldap.ldapjssestarttlsfactory());

$ld = ldap_connect("ldaps://".$host, $port); ldaps$host$port ldap_start_tls($ld); $ld ldap_connect($host, $port); $host $port % keytool -import -file cacert.pem -trustcacerts Enter keystore password: Trust this certificate? [no]: $HOME/.keystore $HOME/.keystore $HOME