Question

I got the BASE64 encoded text by using crypto.signText method. but that dose not contain original to data which is signed.

can anyone tell me how to update that encoded text to attach data to it.

Was it helpful?

Solution

Done.

CMSSignedData csd = new CMSSignedData(byteArr);

if (csd.getSignedContent() == null) {
            byte[] contentBytes;
            if (!isIE) {
                contentBytes = data.getBytes();
            } else {
                //UnicodeLittleUnmarked = Sixteen-bit Unicode Transformation Format, little-endian byte order 
                contentBytes = data.getBytes("UnicodeLittleUnmarked");
            }
            CMSProcessable cmsProcesableContent = new CMSProcessableByteArray(contentBytes);
            csd = new CMSSignedData(cmsProcesableContent, byteArr);
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top