/** * A convenience method to throw a {@link IllegalStateException} is authentication is not yet complete. * * To be called by methods that must only be called after authentication is complete. */ protected void assertComplete() { if (isComplete() == false) { throw log.mechAuthenticationNotComplete(); } }
/** * Wraps a byte array to be sent to the other participant. * * @param outgoing a non-{@code null} byte array containing the bytes to encode * @param offset the first byte to encode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the encoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] wrap(final byte[] outgoing, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.wrap(outgoing, offset, len); }
/** * Unwraps a byte array received from the other participant. * * @param incoming a non-{@code null} byte array containing the bytes to decode * @param offset the first byte to decode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the decoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.unwrap(incoming, offset, len); }
/** * A convenience method to throw a {@link IllegalStateException} is authentication is not yet complete. * * To be called by methods that must only be called after authentication is complete. */ protected void assertComplete() { if (isComplete() == false) { throw log.mechAuthenticationNotComplete(); } }
/** * A convenience method to throw a {@link IllegalStateException} is authentication is not yet complete. * * To be called by methods that must only be called after authentication is complete. */ protected void assertComplete() { if (isComplete() == false) { throw log.mechAuthenticationNotComplete(); } }
/** * A convenience method to throw a {@link IllegalStateException} is authentication is not yet complete. * * To be called by methods that must only be called after authentication is complete. */ protected void assertComplete() { if (isComplete() == false) { throw log.mechAuthenticationNotComplete(); } }
/** * Unwraps a byte array received from the other participant. * * @param incoming a non-{@code null} byte array containing the bytes to decode * @param offset the first byte to decode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the decoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.unwrap(incoming, offset, len); }
/** * Unwraps a byte array received from the other participant. * * @param incoming a non-{@code null} byte array containing the bytes to decode * @param offset the first byte to decode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the decoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.unwrap(incoming, offset, len); }
/** * Wraps a byte array to be sent to the other participant. * * @param outgoing a non-{@code null} byte array containing the bytes to encode * @param offset the first byte to encode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the encoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] wrap(final byte[] outgoing, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.wrap(outgoing, offset, len); }
/** * Wraps a byte array to be sent to the other participant. * * @param outgoing a non-{@code null} byte array containing the bytes to encode * @param offset the first byte to encode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the encoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] wrap(final byte[] outgoing, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.wrap(outgoing, offset, len); }
/** * Unwraps a byte array received from the other participant. * * @param incoming a non-{@code null} byte array containing the bytes to decode * @param offset the first byte to decode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the decoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] unwrap(final byte[] incoming, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.unwrap(incoming, offset, len); }
/** * Wraps a byte array to be sent to the other participant. * * @param outgoing a non-{@code null} byte array containing the bytes to encode * @param offset the first byte to encode * @param len the number of bytes to use * @return A non-{@code null} byte array containing the encoded bytes * @exception SaslException if wrapping fails * @exception IllegalStateException if wrapping is not configured */ public byte[] wrap(final byte[] outgoing, final int offset, final int len) throws SaslException { if (isComplete() == false) throw log != null ? log.mechAuthenticationNotComplete() : legacyLog.mechAuthenticationNotComplete(); SaslWrapper wrapper = this.wrapper; if (wrapper == null) { throw log != null ? log.wrappingNotConfigured() : legacyLog.wrappingNotConfigured(); } if(len == 0) { return NO_BYTES; } return wrapper.wrap(outgoing, offset, len); }