API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IX509CHAIN_GETFIELDPART()

Brew Release
Brew MP 1.0.2
See Also
Error Codes IX509Chain IX509CHAIN_GetRSAKey IX509CHAIN_Verify
Description
This function gets individual extensions or parts out of the subject or issuer.
Params
pMe
[]:
instance of X509Chain.
pReq
[]:
description of the request.
pPart
[]:
filled in with the response.
Interface
  • IX509CHAIN
Prototype
  •   int IX509Chain_GetObjectPart
      (
        const IX509Chain *pMe,
        const X509PartReq *pReq,
        X509Part *pPart
      );
    
Return
  • AEE_SUCCESS: if task is successful. AEE_EFAILED: couldn't find the certificate. AEE_X509_BAD_CERT: the certificate was NULL or can't be parsed. AEE_EBADPARM: asked for a field that we don't know about. AEE_X509_NO_PART: could find an instance of OID requested. AEE_X509_NO_CHAIN_YET: tried to get WEBOPT_X509_CHAIN_CERT before IX509CHAIN_Verify was called.
Side Effect
  • None
Comments
While certificate extensions and subject and issuer parts aren't semantically related they are similar enough in structure that this same function is used to get them. The descriptions above of the data structures describes how to get the different parts by OID or by ASN1OID (our local abbreviations for well known OIDs). The storage for the field has the lifetime of the IX509Chain or until the certificate is removed from the chain. This can be used to iterate over all parts in a field, or over just the values for a particular OID (if there happens to me more than one instances of an OID; the OU part it often duplicated in a subject or issuer). To do the iteration fetch the 0th instance in a field. The response will give you as bonus info, the number of instances in the field, and thus you know how far to iterate. You can also iterate until EFAILED is returned. If you want all parts of a field, give ASNOID_ANY as the OID to look for.