/** * Create a {@code ChannelBinding} whose application data field is set to the given GS2 header, * concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data. * * @param header the GS2 header, excluding the initial gs2-nonstd-flag * @param gs2CbFlagPUsed whether or not a gs2-cb-flag of "p" is used * @param bindingData the channel binding data * @return the {@code ChannelBinding} */ public static ChannelBinding createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData) { ByteStringBuilder appData = new ByteStringBuilder(header); if (gs2CbFlagPUsed) { appData.append(bindingData); } return new ChannelBinding(appData.toArray()); } }
channelBinding == null ? null : channelBinding.getInitiatorAddress(), 5 * 60 * 1000); } catch (KrbException e) { throw new GSSException(GSSException.UNAUTHORIZED, -1, "ApReq verification failed: " + e.getMessage());
@Override public DssContext create(InetSocketAddress remoteSocketAddress, InetSocketAddress localSocketAddress) throws IOException { try { GSSContext context = peer.map(createInitialContext::apply).orElseGet(createAcceptingContext::get); ChannelBinding cb = new ChannelBinding(remoteSocketAddress.getAddress(), localSocketAddress.getAddress(), null); context.setChannelBinding(cb); return new KerberosDssContext(context); } catch (WrappedGssException e) { throw new IOException(e.getCause()); } catch (GSSException e) { throw new IOException(e); } }
/** * Create a {@code ChannelBinding} whose application data field is set to the given GS2 header, * concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data. * * @param header the GS2 header, excluding the initial gs2-nonstd-flag * @param gs2CbFlagPUsed whether or not a gs2-cb-flag of "p" is used * @param bindingData the channel binding data * @return the {@code ChannelBinding} */ public static ChannelBinding createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData) { ByteStringBuilder appData = new ByteStringBuilder(header); if (gs2CbFlagPUsed) { appData.append(bindingData); } return new ChannelBinding(appData.toArray()); } }
/** * Create a {@code ChannelBinding} whose application data field is set to the given GS2 header, * concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data. * * @param header the GS2 header, excluding the initial gs2-nonstd-flag * @param gs2CbFlagPUsed whether or not a gs2-cb-flag of "p" is used * @param bindingData the channel binding data * @return the {@code ChannelBinding} */ public static ChannelBinding createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData) { ByteStringBuilder appData = new ByteStringBuilder(header); if (gs2CbFlagPUsed) { appData.append(bindingData); } return new ChannelBinding(appData.toArray()); } }
/** * Create a {@code ChannelBinding} whose application data field is set to the given GS2 header, * concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data. * * @param header the GS2 header, excluding the initial gs2-nonstd-flag * @param gs2CbFlagPUsed whether or not a gs2-cb-flag of "p" is used * @param bindingData the channel binding data * @return the {@code ChannelBinding} */ public static ChannelBinding createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData) { ByteStringBuilder appData = new ByteStringBuilder(header); if (gs2CbFlagPUsed) { appData.append(bindingData); } return new ChannelBinding(appData.toArray()); } }