public abstract class ChannelWrapper extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ChannelWrapper.Consumer<T>
Interface describing an object that consumes
data from a NIO buffer.
|
static class |
ChannelWrapper.Key<T> |
| Modifier and Type | Field and Description |
|---|---|
protected Map<ChannelWrapper.Key<?>,ChannelWrapper.Consumer<?>> |
consumers |
| Constructor and Description |
|---|
ChannelWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<T> T |
finish(ChannelWrapper.Key<T> object) |
ChannelWrapper.Key<Integer> |
start()
Initializes a byte counter on this channel.
|
ChannelWrapper.Key<byte[]> |
start(org.bouncycastle.openpgp.PGPPrivateKey key,
int algorithm)
Initialize a PGP signatue on the channel
|
ChannelWrapper.Key<byte[]> |
start(PrivateKey key)
Initialize a signature on this channel.
|
ChannelWrapper.Key<byte[]> |
start(String algorithm)
Initialize a digest on this channel.
|
ChannelWrapper.Key<Integer> |
start(WritableByteChannel output) |
protected Map<ChannelWrapper.Key<?>,ChannelWrapper.Consumer<?>> consumers
public ChannelWrapper.Key<Integer> start(WritableByteChannel output)
public ChannelWrapper.Key<Integer> start()
public ChannelWrapper.Key<byte[]> start(PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException
key - the private key to use in signing this data stream.NoSuchAlgorithmException - if the key algorithm is not supportedInvalidKeyException - if the key provided is invalid for signingpublic ChannelWrapper.Key<byte[]> start(org.bouncycastle.openpgp.PGPPrivateKey key, int algorithm)
key - the private key to use in signing this data stream.algorithm - the algorithm to use. Can be extracted from public key.public ChannelWrapper.Key<byte[]> start(String algorithm) throws NoSuchAlgorithmException
algorithm - the digest algorithm to use in computing the hashNoSuchAlgorithmException - if the given algorithm does not existpublic <T> T finish(ChannelWrapper.Key<T> object)
public void close()
throws IOException
IOExceptionCopyright © 2021. All Rights Reserved.