package aalg.crypto;

import java.io.IOException;
import java.io.OutputStream;
import java.math.BigInteger;

import aalg.algebra.Utils;

/**
 * Signature of the DSA cryptosystem.
 * @author Ing. Petr Ležák
 */
public class DsaSignature implements ISignature {
	
	private final BigInteger r;
	private final BigInteger s;
	
	public DsaSignature (final BigInteger r, final BigInteger s) {
		this.r = r;
		this.s = s;
	}

	public BigInteger getR() {
		return r;
	}

	public BigInteger getS() {
		return s;
	}
	
	public void writeToStream(final OutputStream stream) throws IOException {
		Utils.writeNumber(r, stream);
		Utils.writeNumber(s, stream);
	}
}
