@Override public byte[] unwrap(byte[] data, int offset, int len) throws IOException { return client.unwrap(data, offset, len); }
@Override public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { return client.unwrap(incoming, offset, len); }
public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { return delegate.unwrap(incoming, offset, len); }
public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { return saslClient.unwrap(incoming, offset, len); } }
public byte[] unwrap(final byte[] bytes, final int off, final int len) throws SaslException { return saslClient.unwrap(bytes, off, len); }
public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { try { return doPrivileged((PrivilegedExceptionAction<byte[]>) () -> delegate.unwrap(incoming, offset, len), accessControlContext); } catch (PrivilegedActionException pae) { try { throw pae.getCause(); } catch (SaslException | RuntimeException | Error e) { throw e; } catch (Throwable throwable) { throw new UndeclaredThrowableException(throwable); } } }
public byte[] unwrap(byte[] buf) throws SaslException { if (client != null) return client.unwrap(buf, 0, buf.length); else return server.unwrap(buf, 0, buf.length); }
/** * Unwrap a message. Unwrapping occurs from the source buffer to the destination idea. * <p> * The {@code source} buffer should have its position and remaining length set to encompass exactly one SASL * message (without the length field). The SASL message itself does not encode any length information so it is up * to the protocol implementer to ensure that the message is properly framed. * * @param client the SASL client to unwrap with * @param source the buffers from which bytes should be read * @return the wrap result * @throws SaslException if a SASL error occurs * @see SaslClient#unwrap(byte[], int, int) */ public static byte[] unwrap(final SaslClient client, final ByteBuffer source) throws SaslException { final byte[] result; final int len = source.remaining(); if (len == 0) { result = client.unwrap(EMPTY_BYTES, 0, len); } else if (source.hasArray()) { final byte[] array = source.array(); final int offs = source.arrayOffset(); source.position(source.position() + len); result = client.unwrap(array, offs, len); } else { result = client.unwrap(Buffers.take(source, len), 0, len); } return result; }
private CipherOption unwrap(CipherOption option, SaslClient saslClient) throws IOException { byte[] inKey = option.getInKey(); if (inKey != null) { inKey = saslClient.unwrap(inKey, 0, inKey.length); } byte[] outKey = option.getOutKey(); if (outKey != null) { outKey = saslClient.unwrap(outKey, 0, outKey.length); } return new CipherOption(option.getCipherSuite(), inKey, option.getInIv(), outKey, option.getOutIv()); }
obuffer = saslServer.unwrap(saslToken, 0, saslToken.length); } else { // using saslClient obuffer = saslClient.unwrap(saslToken, 0, saslToken.length);
@Override protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { byte[] bytes = new byte[msg.readableBytes()]; msg.readBytes(bytes); ctx.fireChannelRead(Unpooled.wrappedBuffer(saslClient.unwrap(bytes, 0, bytes.length))); } }
LOG.debug("unwrapping token of length:" + token.length); token = saslClient.unwrap(token, 0, token.length); unwrappedRpcBuffer = ByteBuffer.wrap(token);
@Override protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { msg.skipBytes(4); byte[] b = new byte[msg.readableBytes()]; msg.readBytes(b); ctx.fireChannelRead(Unpooled.wrappedBuffer(saslClient.unwrap(b, 0, b.length))); } }
public byte[] unwrap(byte[] buf, int off, int len) throws SaslException { if (saslClient != null) return saslClient.unwrap(buf, off, len); else return saslServer.unwrap(buf, off, len); }
@Override protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { byte[] bytes = new byte[msg.readableBytes()]; msg.readBytes(bytes); ctx.fireChannelRead(Unpooled.wrappedBuffer(saslClient.unwrap(bytes, 0, bytes.length))); } }
@Override public byte[] unwrap(byte[] data, int offset, int len) throws SaslException { assert saslClient != null; return saslClient.unwrap(data, offset, len); } };
@Override public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { return client.unwrap(incoming, offset, len); }
private void fetchDecodedBuffer() throws IOException { DataInputStream dis = new DataInputStream(mySource); int encodedLength = dis.readInt(); if (myReadBuffer.length < encodedLength) { myReadBuffer = new byte[(encodedLength * 3) / 2]; } dis.readFully(myReadBuffer, 0, encodedLength); myByteBuffer = ByteBuffer.wrap(myClient.unwrap(myReadBuffer, 0, encodedLength)); } }
private void fetchDecodedBuffer() throws IOException { DataInputStream dis = new DataInputStream(mySource); int encodedLength = dis.readInt(); if (myReadBuffer.length < encodedLength) { myReadBuffer = new byte[(encodedLength * 3) / 2]; } dis.readFully(myReadBuffer, 0, encodedLength); myByteBuffer = ByteBuffer.wrap(myClient.unwrap(myReadBuffer, 0, encodedLength)); } }
private void fetchDecodedBuffer() throws IOException { DataInputStream dis = new DataInputStream(mySource); int encodedLength = dis.readInt(); if (myReadBuffer.length < encodedLength) { myReadBuffer = new byte[(encodedLength * 3) / 2]; } dis.readFully(myReadBuffer, 0, encodedLength); myByteBuffer = ByteBuffer.wrap(myClient.unwrap(myReadBuffer, 0, encodedLength)); } }