{ "swagger": "2.0", "info": { "title": "Azure Artifact Signing", "version": "2024-06-15", "description": "Azure Artifact Signing is a service that provides managed artifact signing for all.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "OAuth2Auth": [ "https://codesigning.azure.net/.default" ] } ], "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "scopes": { "https://codesigning.azure.net/.default": "" } } }, "tags": [], "paths": { "/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}:sign": { "post": { "operationId": "CertificateProfileOperations_Sign", "summary": "Submit a sign operation.", "description": "Submit a sign operation under the created account and profile name provided.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountName", "in": "path", "description": "Azure Artifact Signing account name.", "required": true, "type": "string" }, { "name": "certificateProfile", "in": "path", "description": "Azure Artifact Signing certificate profile name under an account.", "required": true, "type": "string" }, { "name": "client-version", "in": "header", "description": "An optional client version.", "required": false, "type": "string", "x-ms-client-name": "clientVersion" }, { "name": "x-correlation-id", "in": "header", "description": "An identifier used to batch multiple requests.", "required": false, "type": "string", "x-ms-client-name": "xCorrelationId" }, { "name": "body", "in": "body", "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/SigningPayloadOptions" } } ], "responses": { "202": { "description": "The request has been accepted for processing, but processing has not yet completed.", "schema": { "type": "object", "description": "Provides status details for long running operations.", "properties": { "id": { "type": "string", "description": "The unique ID of the operation." }, "status": { "$ref": "#/definitions/Azure.Core.Foundations.OperationState", "description": "The status of the operation" }, "error": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse", "description": "Error object that describes the error when status is \"Failed\"." }, "result": { "$ref": "#/definitions/SignStatusResult", "description": "The result of the operation." } }, "required": [ "id", "status" ] }, "headers": { "Operation-Location": { "type": "string", "format": "uri", "description": "The location for monitoring the operation state." }, "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Submit a codesign operation.": { "$ref": "./examples/CertificateProfileOperations_Sign.json" } }, "x-ms-long-running-operation": true } }, "/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/{operationId}": { "get": { "operationId": "CertificateProfileOperations_GetSigningStatus", "summary": "Gets the status of a signing operation.", "description": "This status operation requires that a Sign request has been submitted and the operationId is known.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/SigningOptions.accountName" }, { "$ref": "#/parameters/SigningOptions.certificateProfile" }, { "name": "operationId", "in": "path", "description": "The unique ID of the operation.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "type": "object", "description": "Provides status details for long running operations.", "properties": { "id": { "type": "string", "description": "The unique ID of the operation." }, "status": { "$ref": "#/definitions/Azure.Core.Foundations.OperationState", "description": "The status of the operation" }, "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "Error object that describes the error when status is \"Failed\"." }, "result": { "$ref": "#/definitions/SignStatusResult", "description": "The result of the operation." } }, "required": [ "id", "status" ] } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Gets the status of a codesign operation.": { "$ref": "./examples/CertificateProfileOperations_GetSigningStatus.json" } } } }, "/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/certchain": { "get": { "operationId": "CertificateProfileOperations_GetSignCertificateChain", "summary": "Gets the signing certificate chain for that account and profile.", "description": "The certificate chain is generated as part of each profile renewal.", "produces": [ "application/pkcs7-mime", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/SigningOptions.accountName" }, { "$ref": "#/parameters/SigningOptions.certificateProfile" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "type": "file" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Gets the codesigning root certificate on the certificate chain for that account and profile name.": { "$ref": "./examples/CertificateProfileOperations_GetSignCertificateChain.json" } } } }, "/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/eku": { "get": { "operationId": "CertificateProfileOperations_ListExtendedKeyUsages", "summary": "Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.", "description": "The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing operation.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountName", "in": "path", "description": "Azure Artifact Signing account name.", "required": true, "type": "string" }, { "name": "certificateProfile", "in": "path", "description": "Azure Artifact Signing certificate profile name under an account.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PagedExtendedKeyUsage" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Gets a list of extended key usage object identifiers that are allowed.": { "$ref": "./examples/CertificateProfileOperations_ListExtendedKeyUsages.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/rootcert": { "get": { "operationId": "CertificateProfileOperations_GetSignRootCertificate", "summary": "Gets the signing root certificate on the certificate chain for that account and profile name.", "description": "The root certificate is generated as part of the initial account creation and it is used to sign the bits for the profile provided.", "produces": [ "application/x-x509-ca-cert", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/SigningOptions.accountName" }, { "$ref": "#/parameters/SigningOptions.certificateProfile" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "type": "file" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Gets the codesigning root certificate on the certificate chain for that account and profile name.": { "$ref": "./examples/CertificateProfileOperations_GetSignRootCertificate.json" } } } } }, "definitions": { "Azure.Core.Foundations.Error": { "type": "object", "description": "The error object.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" } }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "Azure.Core.Foundations.OperationState": { "type": "string", "description": "Enum describing allowed operation states.", "enum": [ "NotStarted", "Running", "Succeeded", "Failed", "Canceled" ], "x-ms-enum": { "name": "OperationState", "modelAsString": true, "values": [ { "name": "NotStarted", "value": "NotStarted", "description": "The operation has not started." }, { "name": "Running", "value": "Running", "description": "The operation is in progress." }, { "name": "Succeeded", "value": "Succeeded", "description": "The operation has completed successfully." }, { "name": "Failed", "value": "Failed", "description": "The operation has failed." }, { "name": "Canceled", "value": "Canceled", "description": "The operation has been canceled by the user." } ] } }, "ExtendedKeyUsage": { "type": "object", "description": "Extended key usage object identifier that are allowable.", "properties": { "eku": { "type": "string", "description": "An oid string that represents an eku.", "readOnly": true } }, "required": [ "eku" ] }, "PagedExtendedKeyUsage": { "type": "object", "description": "Paged collection of ExtendedKeyUsage items", "properties": { "value": { "type": "array", "description": "The ExtendedKeyUsage items on this page", "items": { "$ref": "#/definitions/ExtendedKeyUsage" } }, "nextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "value" ] }, "SignSignatureAlgorithm": { "type": "string", "description": "Algorithms supported for signing.", "enum": [ "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512", "ES256K" ], "x-ms-enum": { "name": "SignSignatureAlgorithm", "modelAsString": true, "values": [ { "name": "RS256", "value": "RS256", "description": "RSASSA-PKCS1-v1_5 using SHA-256 hash algorithm." }, { "name": "RS384", "value": "RS384", "description": "RSASSA-PKCS1-v1_5 using SHA-384 hash algorithm." }, { "name": "RS512", "value": "RS512", "description": "RSASSA-PKCS1-v1_5 using SHA-512 hash algorithm." }, { "name": "PS256", "value": "PS256", "description": "RSASSA-PSS using SHA-256 hash algorithm." }, { "name": "PS384", "value": "PS384", "description": "RSASSA-PSS using SHA-384 hash algorithm." }, { "name": "PS512", "value": "PS512", "description": "RSASSA-PSS using SHA-512 hash algorithm." }, { "name": "ES256", "value": "ES256", "description": "ECDSA using P-256 and SHA-256 hash algorithm." }, { "name": "ES384", "value": "ES384", "description": "ECDSA using P-384 and SHA-384 hash algorithm." }, { "name": "ES512", "value": "ES512", "description": "ECDSA using P-521 and SHA-512 hash algorithm." }, { "name": "ES256K", "value": "ES256K", "description": "ECDSA using secp256k1 and SHA-256 hash algorithm." } ] } }, "SignStatusResult": { "type": "object", "description": "The sign status model.", "properties": { "signature": { "type": "string", "format": "byte", "description": "Digital signature of the requested content digest." }, "signingCertificate": { "type": "string", "format": "byte", "description": "Signing certificate corresponding to the private key used to sign the requested \ndigest." } } }, "SigningPayloadOptions": { "type": "object", "description": "The artifact request information to be signed by the service.", "properties": { "signatureAlgorithm": { "$ref": "#/definitions/SignSignatureAlgorithm", "description": "The supported signature algorithm identifiers." }, "digest": { "type": "string", "format": "byte", "description": "Content digest to sign." }, "fileHashList": { "type": "array", "description": "List of full file digital signatures.", "items": { "type": "string", "format": "byte" } }, "authenticodeHashList": { "type": "array", "description": "List of authenticode digital signatures.", "items": { "type": "string", "format": "byte" } } }, "required": [ "signatureAlgorithm", "digest" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, "SigningOptions.accountName": { "name": "accountName", "in": "path", "description": "Signing account name.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "SigningOptions.certificateProfile": { "name": "certificateProfile", "in": "path", "description": "Signing Certificate profile name.", "required": true, "type": "string", "x-ms-parameter-location": "method" } } }