I am new to Swift as well as to AWS-IoT.

After reading a tons of doc, I finally decide to post a question for a simple answer.

I am working on a project where I have to interact with "Things". I created an account on AWS and registered "My Thing," create policy and attaching that policy with certificate.

Now I have a private key, a public key certificate and an endpoint url but do not know how to use it in Swift. I checked out this demo, but there is no clear explanation on using private and public keys with certificates; instead of that it contains a constant file as below. What am I supposed to do with the certificate?

let CertificateSigningRequestCommonName = "IoTSampleSwift Application"
let CertificateSigningRequestCountryName = "Your Country"
let CertificateSigningRequestOrganizationName = "Your Organization"
let CertificateSigningRequestOrganizationalUnitName = "Your Organizational Unit"
let PolicyName = "YourPolicyName"

// This is the endpoint in your AWS IoT console. eg: https://xxxxxxxxxx.iot.<region>.amazonaws.com
let AWSRegion = AWSRegionType.Unknown // e.g. AWSRegionType.USEast1
let IOT_ENDPOINT = "https://xxxxxxxxxx.iot.<region>.amazonaws.com"
let ASWIoTDataManager = "MyIotDataManager

Please help me to understand this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.