com.lowagie.text.pdf.ByteBuffer Java Examples

The following examples show how to use com.lowagie.text.pdf.ByteBuffer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ITextPDFSignatureService.java    From dss with GNU Lesser General Public License v2.1 6 votes vote down vote up
private PdfObject generateFileId(PAdESCommonParameters parameters) {
	try (ByteBuffer buf = new ByteBuffer(90)) {
		String deterministicId = DSSUtils.getDeterministicId(parameters.getSigningDate(), null);
		byte[] id = deterministicId.getBytes();
		buf.append('[').append('<');
		for (int k = 0; k < 16; ++k) {
			buf.appendHex(id[k]);
		}
		buf.append('>').append('<');
		for (int k = 0; k < 16; ++k) {
			buf.appendHex(id[k]);
		}
		buf.append('>').append(']');
		return new PdfLiteral(buf.toByteArray());
	} catch (IOException e) {
		throw new DSSException("Unable to generate the fileId", e);
	}
}