1 /* |
1 /* |
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
46 |
46 |
47 // Rewrite keytab, 3 set of keys with different kvno |
47 // Rewrite keytab, 3 set of keys with different kvno |
48 KeyTab ktab = KeyTab.create(OneKDC.KTAB); |
48 KeyTab ktab = KeyTab.create(OneKDC.KTAB); |
49 p = new PrincipalName( |
49 p = new PrincipalName( |
50 OneKDC.SERVER+"@"+OneKDC.REALM, PrincipalName.KRB_NT_SRV_HST); |
50 OneKDC.SERVER+"@"+OneKDC.REALM, PrincipalName.KRB_NT_SRV_HST); |
51 ktab.addEntry(p, "pass1".toCharArray(), 1); |
51 ktab.addEntry(p, "pass1".toCharArray(), 1, true); |
52 ktab.addEntry(p, "pass3".toCharArray(), 3); |
52 ktab.addEntry(p, "pass3".toCharArray(), 3, true); |
53 ktab.addEntry(p, "pass2".toCharArray(), 2); |
53 ktab.addEntry(p, "pass2".toCharArray(), 2, true); |
54 ktab.save(); |
54 ktab.save(); |
55 |
55 |
56 char[] pass = "pass2".toCharArray(); |
56 char[] pass = "pass2".toCharArray(); |
57 kdc.addPrincipal(OneKDC.SERVER, pass); |
57 kdc.addPrincipal(OneKDC.SERVER, pass); |
58 go(OneKDC.SERVER, "com.sun.security.jgss.krb5.accept", pass); |
58 go(OneKDC.SERVER, "com.sun.security.jgss.krb5.accept", pass); |