Creating and updating a trusted certificate by using REST Administration APIs
System administrators can copy a trusted certificate to be used in Eclipse Amlen to Eclipse Amlen by using the Eclipse Amlen REST API PUT method. System administrators can then import the trusted certificate to the truststore that is referenced in the Security Profile by using the Eclipse Amlen REST API POST method. Existing trusted certificate's security profiles can also be updated by system administrators by using the Eclipse Amlen REST API POST method.
You can upload a trusted certificate by using the Eclipse Amlen REST API PUT, or by using the Amlen WebUI. For more information about using the Amlen WebUI to upload a trusted certificate, see Configuring trusted certificates by using the Amlen WebUI.
- Copy the certificate to /var/lib/amlen-server/userfiles by using the REST API PUT method:
curl -X PUT -T imaCA-crt.pem http://127.0.0.1:9089/ima/v1/file/TestCACertKey.pem
- Copy the certificate and key to /var/lib/amlen-server/userfiles to create a CertificateProfile by using the REST API PUT method:
curl -X PUT -T certFree.pem http://127.0.0.1:9089/ima/v1/file/TestCert.pem curl -X PUT -T keyFree.pem http://127.0.0.1:9089/ima/v1/file/TestKey.pem
- Create the CertificateProfile by using the REST API POST method:
curl -X POST \ -H 'Content-Type: application/json' \ -d '{ "CertificateProfile":{ "TestCertProf":{ "Certificate": "TestCert.pem", "Key": "TestKey.pem" } } } ' \ http://127.0.0.1:9089/ima/v1/configuration
- Create the SecurityProfile by using the REST API POST method:
curl -X POST -H 'Content-Type: application/json' \ -d '{ "SecurityProfile":{ "TestSecProf":{ "CertificateProfile": "TestCertProf", "UsePasswordAuthentication": false } } } ' \ http://127.0.0.1:9089/ima/v1/configuration
- Create the TrustedCertificate by using the REST API POST method:
curl -X POST -H 'Content-Type: application/json' \ -d '{"TrustedCertificate":[{ "SecurityProfileName":"TestSecProf", "TrustedCertificate": "TestCACertKey" }] } ' \ http://127.0.0.1:9089/ima/v1/configuration
{
"Version": "v1",
"Code": "CWLNA6011",
"Message": "The requested configuration change has completed successfully."
}