| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.channels.ByteChannel; |
| | |
| | | |
| | | import org.opends.server.api.ClientConnection; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a SASL byte channel that can be used during |
| | | * confidentiality and integrity. |
| | |
| | | public final class SASLByteChannel implements ConnectionSecurityProvider |
| | | { |
| | | |
| | | /** |
| | | * Private implementation. |
| | | */ |
| | | /** Private implementation. */ |
| | | private final class ByteChannelImpl implements ByteChannel |
| | | { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isOpen() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int write(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Attempt to read and unwrap the next SASL packet. |
| | | /** Attempt to read and unwrap the next SASL packet. */ |
| | | private int doRecvAndUnwrap() throws IOException |
| | | { |
| | | // Read SASL packets until some unwrapped data is produced or no more |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteChannel getChannel() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Certificate[] getClientCertificateChain() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure() |
| | | { |