Package org.apache.pdfbox.pdmodel.interactive.digitalsignature

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface.sign()


        SequenceInputStream signStream = new SequenceInputStream(new ByteArrayInputStream(inputBytes),
                new ByteArrayInputStream(signBuffer));

        // sign the bytes
        SignatureInterface signatureInterface = doc.getSignatureInterface();
        byte[] sign = signatureInterface.sign(signStream);
        String signature = new COSString(sign).getHexString();
        // substract 2 bytes because of the enclosing "<>"
        if (signature.length() > signatureLength - 2)
        {
            throw new IOException("Can't write signature, not enough space");
View Full Code Here


            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
                throw new IOException("Can't write signature, not enough space");
            getStandardOutput().setPos(signaturePosition[0]+1);
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int startPos = signaturePosition[0] + 1; // move past "<"
            int endPos = signaturePosition[1] - 1; // move in front of ">"
            if (startPos + signature.length() > endPos)           
            {
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

            byte[] pdfContent = bytes.toByteArray();
            // End - extracting document
       
            SignatureInterface signatureInterface = doc.getSignatureInterface();
            byte[] sign = signatureInterface.sign(new ByteArrayInputStream(pdfContent));
            String signature = new COSString(sign).getHexString();
            int leftSignaturerange = signaturePosition[1]-signaturePosition[0]-signature.length();
            if(leftSignaturerange<0)
            {
                throw new IOException("Can't write signature, not enough space");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.