org.ietf.jgss.ChannelBinding Java Examples

The following examples show how to use org.ietf.jgss.ChannelBinding. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GSSLibStub.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #2
Source File: GSSLibStub.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #3
Source File: GSSLibStub.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #4
Source File: NoAddresses.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #5
Source File: GSSLibStub.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #6
Source File: GSSLibStub.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #7
Source File: NoAddresses.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #8
Source File: GSSLibStub.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #9
Source File: GSSLibStub.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #10
Source File: NoAddresses.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #11
Source File: NoAddresses.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #12
Source File: GSSLibStub.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #13
Source File: NoAddresses.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #14
Source File: MockingKerberizedClient.java    From elasticsearch-shield-kerberos-realm with Apache License 2.0 4 votes vote down vote up
@Override
public void setChannelBinding(final ChannelBinding cb) throws GSSException {
    throw new UnsupportedOperationException("mock gss context does not support this operation");
}
 
Example #15
Source File: GSSLibStub.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #16
Source File: GSSLibStub.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #17
Source File: NoAddresses.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #18
Source File: GSSLibStub.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #19
Source File: GSSLibStub.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #20
Source File: NoAddresses.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #21
Source File: GSSLibStub.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #22
Source File: GSSLibStub.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #23
Source File: NoAddresses.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #24
Source File: GSSLibStub.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #25
Source File: GSSLibStub.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #26
Source File: NoAddresses.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #27
Source File: GSSLibStub.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #28
Source File: GSSLibStub.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
native byte[] acceptContext(long pCred, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);
 
Example #29
Source File: NoAddresses.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();
    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            "noaddresses = false",
            "default_keytab_name = " + OneKDC.KTAB);
    Config.refresh();

    Context c = Context.fromJAAS("client");
    Context s = Context.fromJAAS("server");

    c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
    s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);

    InetAddress initiator = InetAddress.getLocalHost();
    InetAddress acceptor = InetAddress.getLocalHost();
    switch (args[0]) {
        case "1":
            // no initiator host address available, should be OK
            break;
        case "2":
            // correct initiator host address, still fine
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
        case "3":
            // incorrect initiator host address, fail
            initiator = InetAddress.getByAddress(new byte[]{1,1,1,1});
            c.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            s.x().setChannelBinding(
                    new ChannelBinding(initiator, acceptor, null));
            break;
    }

    Context.handshake(c, s);
}
 
Example #30
Source File: GSSLibStub.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
native byte[] initContext(long pCred, long targetName, ChannelBinding cb,
byte[] inToken, NativeGSSContext context);