public Key< byte[]> start( final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException {
		final Signature signature = Signature.getInstance( key.getAlgorithm());
		signature.initSign( key);
		final Key< byte[]> object = new Key< byte[]>();
		consumers.put( object, new Consumer< byte[]>() {
			public void consume( final ByteBuffer buffer) {
				try {
					signature.update( buffer);
				} catch ( Exception e) {
					throw new RuntimeException( e);
				}
			}
			public byte[] finish() {
				try {
					return signature.sign();
				} catch ( Exception e) {
					throw new RuntimeException( e);
				}
			}
		});
		return object;
	}
public Key < byte [ ] > start ( final PrivateKey key ) throws NoSuchAlgorithmException , InvalidKeyException { final Signature signature = Signature . getInstance ( key . getAlgorithm ( ) ) ; signature . initSign ( key ) ; final Key < byte [ ] > object = new Key < byte [ ] > ( ) ; consumers . put ( object , new Consumer < byte [ ] > ( ) { public void consume ( final ByteBuffer buffer ) { try { signature . update ( buffer ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } public byte [ ] finish ( ) { try { return signature . sign ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } } ) ; return object ; }
Initialize a signature on this channel.

@param key the private key to use in signing this data stream.
@return reference to the new key added to the consumers
@throws NoSuchAlgorithmException if the key algorithm is not supported
@throws InvalidKeyException if the key provided is invalid for signing