PDF/A document identification

Q: Is there a property set within PDF/A file's metadata that I can
get to through the SDF object? I could not explicitly locate one so I
rolled my own and create a meta data value to tag the document as
PDFA. I can then use this property for Boolean checks required for
various workflow scenarios. I am now informed that certain business
units here use external tools from time to time to convert pdf
documents to pdfa and hence my property will not be set. I could not
find a method (e.g. doc.IsPDFA()) to check if a document is PDF/A
compliant. If this type of method is not available I think it would be
an important feature to add to the SDK.
--------------------
A: A quick way to check if a file pdf/a complaint is to search for
"pdfaid" string in the metadata stream
(pdfdoc.GetRoot().FindObj("Metatada")). Unfortunately this method is
frequently returning false positives since there are many non-
compliant PDF files which are marked as PDF/A. Also, there are many
PDF generators out there which are tagging PDFs as being PDF/A
compliant when in-fact they are not compliant. PDFNet provides a PDF/A
validator (pdftron.PDF.PDFACompliance) which is a more reliable way to
establish if a document is PDF/A compliant. It should be very simple
to wrap PDFACompliance in a IsPDFA(file) method:

- Run PDFACompliance on a PDF.
- If PDFACompliance reports 0 errors the file is PDF/A compliant,
otherwise it is not compliant.

Q: I am trying your idea:
Where am I going wrong here?

Doc being passed in has just been converted and did so without error.
This is my IsPdfa function
Which returns false.
  doc.InitSecurityHandler();
  DictIterator searchMeta =
doc.GetRoot().FindObj("Metadata").Find("pdfaid");
  if (searchMeta.HasNext())
  {
      return true;
  }
-------------------
A: Metatada is a stream object. You would need to extract data from
the stream.

Obj stm = pdfdoc.GetRoot().FindObj("Metatada");
if (stm != null) {
    byte[] data = stm.Read(20000);
    ... convert to UTF8 using .NET API
    ... search for "pdfaid" in the string
}