Class SignedData

java.lang.Object
com.codename1.backend.security.pki.SignedData

public final class SignedData extends Object

The content and the certificates of a CMS SignedData structure (RFC 5652), the PKCS#7 envelope a .mobileprovision profile, a signed manifest or a detached signature file arrives in.

SignedData signed = SignedData.decode(profileBytes);
byte[] plist = signed.getContent();
List<Certificate> chain = signed.getCertificates();

It reads; it does not judge. Nothing here checks the signer's signature over the content or the chain behind it: validate the certificates with CertificateValidator and trust the content only as far as that goes. Like the rest of this package it reads DER, so a BER encoding with indefinite lengths is reported as such.

  • Field Details

  • Method Details

    • decode

      public static SignedData decode(byte[] der) throws IOException
      Reads a ContentInfo that holds SignedData.
      Throws:
      IOException
    • getContentType

      public String getContentType()
      The type of the content, DATA for plain bytes.
    • getContent

      public byte[] getContent()
      The signed content, or null when the signature is detached.
    • getCertificates

      public List<Certificate> getCertificates()
      The certificates the sender included, in the order sent; usually the signer's and the intermediates behind it.
    • getSignerCount

      public int getSignerCount()
      How many signers signed it.