Cloud API Log Encrypt Error

Completed

Comments

4 comments

  • DJI Developer Support
    1. The key set through JSBridge is an RSA public key; kindly ensure there's no mix-up between the public and private keys. 2. If you're using SSL certificates, please note that only Cloudflare and GoDaddy certificates are compatible for use in this case.
    0
    Comment actions Permalink
  • Yogesh

    Thanks for the quick response. For me it still does not work.

    1. Does the key has to be base64 encoded with utf-8 ?

    2. Does the key only contain the actual key without the "-----BEGIN PUBLIC KEY-----" and "-----END PUBLIC KEY-----"?

    3. Is the following enough to generate a valid key for encrpytion or do you have maybe some instruction using the openssl tool?

    openssl genrsa > pvtkey.key
    openssl rsa -in pvtkey.key -pubout -out public.pem

    4. Do you have a sample android project which does this encryption using the public key for better understanding how it works for the Pilot 2 app?

    5. I use only the public key to encrypt the data and try to set it using the jsbridge api. Is this the right way to do it?

    Thanks for your support again

    0
    Comment actions Permalink
  • DJI Developer Support
    1. RSA keys are already Base64 encoded upon generation. 2. The key only consists of the actual key data and does not include the "-----BEGIN PUBLIC KEY-----" or "-----END PUBLIC KEY-----" wrappers. 3. It's alright to generate RSA keys using the following commands: openssl genrsa > pvtkey.key openssl rsa -in pvtkey.key -pubout -out public.pem 4. Apologies, but we don't currently have a demo available for this purpose. Also, please note that when encrypting, you should be using the public key, and it should be the public key stripped of newline characters.
    1
    Comment actions Permalink
  • Yogesh

    This was really helpful, thanks a lot for your help!

    0
    Comment actions Permalink

Please sign in to leave a comment.