All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.libg.cryptography.Signer Maven / Gradle / Ivy

Go to download

A main program (executable JAR) that will listen to port 29998. At first, it can only answer that it is an Envoy (a limited agent). The only function it supports is installing a -runpath. It will then create a framework + agent and transfer the connection to the just installed agent who will then install the bundles. This JAR is a main command for JPM called bndremote. In JPM, it will start up with debug enabled. This JAR does some highly complicated class loading wizardy to ensure that it does not enforce any constraints on the -runpath.

The newest version!
package aQute.libg.cryptography;

import java.io.IOException;
import java.io.OutputStream;
import java.security.Signature;
import java.security.SignatureException;

public class Signer extends OutputStream {
	Signature	signature;
	Digester	digester;

	Signer(Signature s, Digester digester) {
		this.signature = s;
		this.digester = digester;
	}

	@Override
	public void write(byte[] buffer, int offset, int length) throws IOException {
		try {
			signature.update(buffer, offset, length);
			digester.write(buffer, offset, length);
		} catch (SignatureException e) {
			throw new IOException(e.getLocalizedMessage());
		}
	}

	@Override
	public void write(int b) throws IOException {
		try {
			signature.update((byte) b);
			digester.write(b);
		} catch (SignatureException e) {
			throw new IOException(e.getLocalizedMessage());
		}
	}

	public Signature signature() throws Exception {
		return signature;
	}

	public D digest() throws Exception {
		return digester.digest();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy