@Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { MessageProp prop = new MessageProp(0, confidential); try { byte[] response = gssContext.wrap(outgoing, offset, len, prop); saslGssapi.tracef("Wrapping message of length '%d' resulting message of length '%d'", len, response.length); return response; } catch (GSSException e) { throw saslGssapi.mechUnableToWrapMessage(e).toSaslException(); } }
response = gssContext.wrap(response, 0, response.length, msgProp);
response = gssContext.wrap(response, 0, 4, msgProp); } catch (GSSException e) { throw saslGssapi.mechUnableToGenerateChallenge(e).toSaslException();
protected byte[] wrap() throws IOException { try { return context.wrap(this.buff, 0, this.index, null); } catch (GSSException e) { throw new ChainedIOException("wrap failed", e); } }
protected byte[] wrap() throws IOException { try { return context.wrap(this.buff, 0, this.index, null); } catch (GSSException e) { throw new ChainedIOException("wrap failed", e); } }
@Override protected byte[] encryptInternal(final byte[] bytes) throws EncryptionCodecException { LOGGER.trace("encryptInternal() called..."); try { LOGGER.debug("Encrypting content with context.wrap()..."); return context.wrap(bytes, 0, bytes.length, new MessageProp(0, true)); } catch (final GSSException gsse) { throw new EncryptionCodecException("Unable to encrypt the outgoing ACI data.", gsse); } }
@Override public byte[] wrap(byte[] data, int offset, int len) throws IOException { checkState(isEstablished()); try { return context.wrap(data, offset, len, prop); } catch (GSSException e) { throw new IOException("Failed to wrap message: " + e.getMessage(), e); } }
/** * Wrap a key */ public byte[] wrapKey(byte[] secret) throws WSSecurityException { MessageProp mProp = new MessageProp(0, true); try { return secContext.wrap(secret, 0, secret.length, mProp); } catch (GSSException e) { if (LOG.isDebugEnabled()) { LOG.debug("Error in cleaning up a GSS context", e); } throw new WSSecurityException( WSSecurityException.FAILURE, "spnegoKeyError", null, e ); } }
/** * Wrap a key */ public byte[] wrapKey(byte[] secret) throws WSSecurityException { MessageProp mProp = new MessageProp(0, true); try { return secContext.wrap(secret, 0, secret.length, mProp); } catch (GSSException e) { LOG.debug("Error in cleaning up a GSS context", e); throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, e, "spnegoKeyError" ); } }
/** * Wrap a key */ public byte[] wrapKey(byte[] secret) throws WSSecurityException { MessageProp mProp = new MessageProp(0, true); try { return secContext.wrap(secret, 0, secret.length, mProp); } catch (GSSException e) { if (LOG.isDebugEnabled()) { LOG.debug("Error in cleaning up a GSS context", e); } throw new WSSecurityException( WSSecurityException.FAILURE, "spnegoKeyError", null, e ); } }
/** * Utility method to call GSSContext.wrap() on a message which will create a byte[] * that can be sent to a remote peer. * @param context GSSContext for which a connection has been established to the remote peer * @param prop the MessageProp object that is used to provide Quality of Protection of the message * @param message the bytes of the message to be sent to the remote peer * @return the protected bytes of the message that can be sent to and unpacked by the remote peer */ @Function public static byte[] wrapMessage(GSSContext context, MessageProp prop, byte[] message) { try { // wrap the data and return the encrypted token byte[] initialToken = context.wrap(message, 0, message.length, prop); return getTokenWithLengthPrefix(initialToken); } catch (GSSException ex) { throw new RuntimeException("Exception wrapping message", ex); } }
public byte[] run() throws Exception { final GSSContext context = getTicketValidation().getGssContext(); return context.wrap(data, offset, length, new MessageProp(true)); } });
@Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { MessageProp prop = new MessageProp(0, confidential); try { byte[] response = gssContext.wrap(outgoing, offset, len, prop); saslGssapi.tracef("Wrapping message of length '%d' resulting message of length '%d'", len, response.length); return response; } catch (GSSException e) { throw saslGssapi.mechUnableToWrapMessage(e).toSaslException(); } }
@Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { MessageProp prop = new MessageProp(0, confidential); try { byte[] response = gssContext.wrap(outgoing, offset, len, prop); saslGssapi.tracef("Wrapping message of length '%d' resulting message of length '%d'", len, response.length); return response; } catch (GSSException e) { throw saslGssapi.mechUnableToWrapMessage(e).toSaslException(); } }
@Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { MessageProp prop = new MessageProp(0, confidential); try { byte[] response = gssContext.wrap(outgoing, offset, len, prop); saslGssapi.tracef("Wrapping message of length '%d' resulting message of length '%d'", len, response.length); return response; } catch (GSSException e) { throw saslGssapi.mechUnableToWrapMessage(e).toSaslException(); } }
token = context.wrap(messageBytes, 0, messageBytes.length, prop);
response = gssContext.wrap(response, 0, response.length, msgProp);
response = gssContext.wrap(response, 0, response.length, msgProp);
response = gssContext.wrap(response, 0, response.length, msgProp);
response = gssContext.wrap(response, 0, 4, msgProp); } catch (GSSException e) { throw saslGssapi.mechUnableToGenerateChallenge(e).toSaslException();