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

Developer

API Reference

ICERTPARSE_SETCERT()

Brew Release
Brew MP 1.0.2
See Also
Error Codes ICertParse ICertParse_SetCertByOpt()
Description
Set the certificate to be parsed
Params
pif
[]:
The Interface pointer.
pCert
[]:
Pointer to a DER encoded X.509 certificate.
nCertLen
[]:
Length of the buffer pointed to by pCert.
Interface
Prototype
  •    int ICertParse_SetCert
       (
          ICertParse  *pif,
          const uint8 *pCert,
          int          nCertLen
       );
    
Return
  • AEE_SUCCESS: Certificate set successfully. AEE_EFAILED: pCert is NULL or nCertLen is empty. AEESEC_X509_BAD_CERT: error parsing the cert.
    Can also return other implementation specific error codes.
Side Effect
  • None
Comments
Sets the certificate to be parsed. The certificate is not copied. Only a pointer to it is kept so the life time of the pointer passed must extend to all calls to ICertParse and for the usage of pointers returned from parsing, particularly GetField and GetFieldPart. It is safe to ignore the error returned by this function. All the other parsing functions return proper error codes even when called after this function returns an error. The length passed in must be precisely the length of the certificate. A parsing error is returned if it is not.