This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SSL CERTIFICATION READ ISSUE NRF9160 FOTA

Hi,

 i am trying to read the written certificate detail to verify. but i got the error of EPERM, 

 The below log is the response for my aws_fota program, 

The MQTT AWS Jobs FOTA Sample


nrf_inbuilt_key_delete(16842753, 0) => result=0


nrf_inbuilt_key_delete(16842753, 1) => result=0


nrf_inbuilt_key_delete(16842753, 2) => result=0


nrf_inbuilt_key_write => result=0


nrf_inbuilt_key_write => result=0


nrf_inbuilt_key_write => result=0

i got the CA detail and i got EPERM error for both private and public key detail. find my code below

u8_t buffer_read[2000]; // declared globally

void read_Credential()
{
  int err;
  u16_t size = 2000;
  err = nrf_inbuilt_key_read(CONFIG_CLOUD_CERT_SEC_TAG,NRF_KEY_MGMT_CRED_TYPE_CA_CHAIN,
                           &buffer_read,&size);
                           if(err == 0)
                           {
                            printk("Read CA Successfully\n %s\n",buffer_read);
                           }
                           else
                           {
                            printk("Read Failure%d",err);
                           }
                           memset(buffer_read,'\0',strlen(buffer_read));

     err = nrf_inbuilt_key_read(CONFIG_CLOUD_CERT_SEC_TAG,NRF_KEY_MGMT_CRED_TYPE_PRIVATE_CERT,
                           &buffer_read,&size);
                           if(err == 0)
                           {
                            printk("Read PRIV successfully\n %s\n",buffer_read);
                           }
                           else
                           {
                            printk("Read Failure%d",err);
                           }
                           memset(buffer_read,'\0',strlen(buffer_read));

          err = nrf_inbuilt_key_read(CONFIG_CLOUD_CERT_SEC_TAG,NRF_KEY_MGMT_CRED_TYPE_PUBLIC_CERT,
                           &buffer_read,&size);
                           if(err == 0)
                           {
                            printk("Read PUB Successfully\n %s\n",buffer_read);
                           }
                           else
                           {
                            printk("Read Failure%d",err);
                           }
                           memset(buffer_read,'\0',strlen(buffer_read));
}


once i through this, i have to ensure the mqtt data push....

kindly help me to sort this out

Related