0

I am currently working on digitally signing PDF files using Adobe AATL and it seems that my code for it is not working. I was provided by the AATL provider with a Certificate Chain and Certificate. When I try (using Java Code) to digitally sign a PDF. It seems that my and other colleague's machine the certificate chain becomes visible. But for other machines, it seems to not work. Would appreciate some guidance.

I'm a clueless teddy bear on how to fix this issue, so far the code that I got is displayed below:

    PrivateKey privKey = null;
    byte[] encoded = Util.exportKey(handle);
    byte[] keyAttribute = Util.getKeyAttributes(handle);
    CaviumKeyAttributes cka = new CaviumKeyAttributes(keyAttribute);

    if (cka.getKeyType() == CaviumKeyAttributes.KEY_TYPE_RSA && cka.getKeyClass() == CaviumKeyAttributes.CLASS_PRIVATE_KEY) {
        KeyFactory factory = KeyFactory.getInstance("RSA");
        PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(encoded);
        privKey = factory.generatePrivate(spec);
    }

    if (certi == null) {
        throw new IOException("Could not find certificate");
    }

    Certificate[] certifcates = new Certificate[1];
    certifcates[0] = certi;

    setCertificateChain(certifcates);
    setPrivateKey(privKey);

What can I say is that when I try to view the certificate details of the PDF, I can see the AATL provider's certificate on my machine. However, I can't see the similar thing on other peoples laptop. I always make sure that the AATL list recognized by their PDF viewers are updated. I'm currently thinking that this issue originates from the fact the certificate chain is not included.

Would appreciate some help ^_^

Tilman Hausherr
  • 17,731
  • 7
  • 58
  • 97
Allan Chua
  • 9,305
  • 9
  • 41
  • 61

0 Answers0