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

Developer

API Reference

IPUBKEYUTIL_PARSE()

Brew Release
Brew MP 1.0.2
See Also
None
Description
Parse a key format of type nType pointed to by pIn with total length of nInLen. After parsing, the contents are copied to the object passed in piOut.
Params
pif
[]:
[in] interface pointer
nType
[]:
[in] encoding type to parse
pIn
[]:
[in] pointer to encoded data
nInLen
[]:
[in] size of encoded data
piOut
[]:
[in/out] interface pointer where parsed data is to be stored if operation is successful.
Interface
Prototype
  • int IPubKeyUtil_Parse(IPubKeyUtil *pif, int nType, 
                          const uint8 *pIn, int nInLen, IParameters1 *piOut )
    
Return

  • AEE_SUCCESS: Parse completed successfully
    AEE_EBADPARM: Invalid parameter
    AEE_ENOMEMORY: Out of memory while trying to store the parsed data.
    AEESEC_X509_BAD_KEY: Bad key format in pIn
    AEESEC_X509_UNKNOWN_KEY: Unable to parse this Key type.
    -- other error codes as returned by implementation

Side Effect
  • None
Comments
Defined values for parameter nType: IPUBKEYUTIL_ASN1: Any key in ASN.1 format that the parser knows about. OIDs are used to distinguish key types. Other implementations may define other types. Caller must call IParameters1_GetParam on piOut once this call is completed to confirm that requried parameters are present. This function will try to store parsed data in the piOut object provided but makes no effort in returning the error codes (except AEE_ENOMEMORY) if it is not able to do so. Also each implementation can choose to not parse all the key types within a domain so its mandatory for implmentations to mention the OID's that they can successfully parse.