I am building a system where I would like to send an encrypted message from AWS Lambda (via an AWS IoT Core rule) to a device. Ideally I would like to encrypt this message using the device's public key (stored within AWS IoT Core); however, I cannot find any documentation on how to retrieve the certificate used to authenticate the device nor it's public key using the AWS SDk (for any language). I'm curious if anyone has been able to achieve something similar.
I am partially modelling my solution after iRobot's solution presented at re:Invent 2016: (video). I assume that it is possible in some way otherwise I'm not sure how the presenter would have accomplished this.
It's also possible that there is a better approach in more recent iterations of AWS IoT Core, so I'm open to suggestions on different ways to approach this issue.