Utilizzo delle Web API

Gran Parte delle operazioni che si effettuano via portale SCM possono essere svolte via Web API e quindi possono essere scriptabili e automatizzate.

SI RIMANDA ALLA DOCUMENTAZIONE UFFICIALE SECTIGO PER UN COMPENDIO ESAUSTIVO

Per potere utilizzare le Web API bisogna avere un account dedicato abilitato all'utilizzo di queste inoltre bisogna essere a conoscenza di alcuni parametri che servono per effettuare le query:

Queste informazioni specifiche per latipologia di certificato e il Dipartimento per il quale si richiede il certificato. Le query sono effettuate utilizzando json. Alcuni esempi di utilizzo delle API. Nell'esempio sono utilizzati valori fittizi non corrispondenti a valori validi:

<html> <body> <pre> curl 'https://cert-manager.com/api/ssl/v1/' -i -X GET -H 'login: username' -H 'Content-Type: application/json' -H 'password: PaSsWoRd' -H 'customerUri: MYURI' </pre> </body> </html>

<html> <body> <pre> curl 'https://cert-manager.com/api/ssl/v1/3837437' -i -X GET -H 'login: username' -H 'Content-Type: application/json' -H 'password: PaSsWoRd' -H 'customerUri: MYURI' </pre> </body> </html>

<html> <body> <pre> —–BEGIN CERTIFICATE REQUEST—– MIICpDCCAYwCAQAwXzEuMCwGA1UECgwlSXN0aXR1dG8gTmF6aW9uYWxlIGRpIEZp c2ljYSBOdWNsZWFyZTENMAsGA1UECwwEQ05BRjEeMBwGA1UEAwwVcHJvdmExMDAu Y25hZi5pbmZuLml0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7rCf wPb5pm5kwkmqg8nxVWhUAebJBozTFrpIW4Wcc1CzqEcYn2MwP9pPwyG8E/yEZaO5 hKCPY3lWsMz7YN0PdmoOHl9W9wWpgCh5byn9+bC7EA1G+va97UxGD/ZoEcvW+qga CrARGwaEITP8TgKUaaj2/tUSv6f1DuoM1ohEd1I0kf8cKQQMnrp78nNGeahdmHZN EKAZU9DrDczUczyvQNwDMAoMZVCoqkRsDE1RQ5ncXfP7CssoC1ojmZQQUsalcGW4 gUxUklSQZ7USUza3gxXsVT0HOZ5L9lUJEFfxg5uofhAiEkY/SI2bEuVJwM07gUaq 75LOhBG3JtFXU1R/LwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAMEvt3RVNUXm 7pOVS5C8IpnIqJe20xEtHDp9boBASuz9bCnLwiEUM0r9AnxvbSFflQcBNkG1LiLn a4GCRJS7/fGKA69ckNme+IISVxcuPmNUqz/mFRGtvyV1qCau+Cx5b37Yh6W4OrW+ 0AzVpK32cmhWr7DrSBKY7/fxDVAhVEHGR02cppe5OFjxhyx6insGPKvinKR5Su+u zkrWhFJl3ksD41K01fL63iDfB/RpKjxhnHq4KtEa5VkcIPkEaDaDeDUKF2FJbkLd 3jEzMYDBcLbye0rh0Jtlv528tA2BJOor+Gp2UjYEkeTJDf+UnW+sPf2EQhud6BCU Za9+U13qcW8= —–END CERTIFICATE REQUEST—– </pre> </body> </html>

<html> <body> <pre> curl 'https://cert-manager.com/api/ssl/v1/enroll' -i -X POST -H 'login: username' -H 'Content-Type: application/json' -H 'password: PaSwWoRd' -H 'customerUri: MYURI' -d '{"orgId":111111,"subjAltNames":"","certType":101010,"term":365,"csr":"—–BEGIN CERTIFICATE REQUEST—–\nMIICpDCCAYwCAQAwXzEuMCwGA1UECgwlSXN0aXR1dG8gTmF6aW9uYWxlIGRpIEZp\nc2ljYSBOdWNsZWFyZTENMAsGA1UECwwEQ05BRjEeMBwGA1UEAwwVcHJvdmExMDAu\nY25hZi5pbmZuLml0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7rCf\nwPb5pm5kwkmqg8nxVWhUAebJBozTFrpIW4Wcc1CzqEcYn2MwP9pPwyG8E/yEZaO5\nhKCPY3lWsMz7YN0PdmoOHl9W9wWpgCh5byn9+bC7EA1G+va97UxGD/ZoEcvW+qga\nCrARGwaEITP8TgKUaaj2/tUSv6f1DuoM1ohEd1I0kf8cKQQMnrp78nNGeahdmHZN\nEKAZU9DrDczUczyvQNwDMAoMZVCoqkRsDE1RQ5ncXfP7CssoC1ojmZQQUsalcGW4\ngUxUklSQZ7USUza3gxXsVT0DdJ5L9lUJEFfxg5uofhAiEkY/SI2bEuVJwM07gUaq\n75LOhBG347Fc01R/LwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAMEvt3RVNUXm\n7pOVS5C8IpnIqJe20xEtHDp9boBASuz9bCnLwiEUM0r9AnxvbSFflQcBNkG1LiLn\na4GCRJS7/fGKA69ckNme+IISVxcuPmNUqz/mFRGtvyV1qCau+Cx5b37Yh6W4OrW+\n0AzVpK32cmhWr7DrSBKY7/fxDVAhVEHGR02cppe5OFjxhyx6insGPKvinKR5Su+u\nzkrWhFJl3ksD41K0welU4iDfB/RpKjxhnHq4KtEa5VkcIPkEaDaDeDUKF2FJbkLd\n3jEzMYDBcLbye0rh0Jtlv528tA2BJOor+Gp2UjYEkeTJDf+UnW+sPf2EQhud6BCU\nZa9+U13qcW8=\n—–END CERTIFICATE REQUEST—–"}' </pre> </body> </html>