views:

23

answers:

1

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.

A: 

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);
        }
Romani