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

Developer

API Reference

IX509CHAIN_GETRSAKEY()

Brew Release
Brew MP 1.0.2
See Also
Error Codes IRSA IX509Chain IX509CHAIN_GetRSAKey IX509CHAIN_Verify
Description
This function gets an the RSA key as an IRSA object that is ready for use.
Params
pMe
[]:
instance of X509Chain.
nCertWebOpt
[]:
which WebOpt set to get them from; either WEBOPT_X509_ROOT_CERT, xxx_LEAF_CERT, or xxx_BRANCH_CERT
nCertIndex
[]:
index of certificate of the given option type to get.
ppiRSA
[]:
place to put pointer to newly created IRSA interface.
Interface
  • IX509CHAIN
Prototype
  •     int IX509Chain_GetKey
        (
          const IX509Chain *pMe, 
          int32 nCertWebOpt, 
          int32 nCertIndex, 
          IRSA **ppiRSA
        );
    
Return
  • AEE_SUCCESS: if task is successful. AEE_EFAILED: couldn't find the certificate. AEE_X509_BAD_CERT: certificate parsed incorrectly. AEE_X509_NO_CHAIN_YET: tried to get WEBOPT_X509_CHAIN_CERT before IX509CHAIN_Verify() was called, or there was no leaf certificate. AEE_X509_BAD_KEY: key can't be parsed out. AEE_X509_UNKNOWN_KEY: key isn't RSA. AEE_ENOMEMORY: insufficient memory to store key and instantiate IRSA. AEE_ECLASSNOSUPPORT: no RSA algorithm support on this device. AEE_CRYPT_INVALID_KEY: parsed the key, but something is wrong with it
Side Effect
  • None
Comments
This returns the RSA key in the cert by instantiating an IRSA so it's ready for use. Be sure to release the IRSA instance when you're done. Also ppiRSA should NOT be NULL.