POST Codesign/UpdateEnvironment

Updates CodeSign Protect Environment settings that appear in an approved project.

Requirements

  • Permissions:  The caller must be a Code Signing Administrator, or a Owner.
  • Token scope:  Codesign:Manage

Headers

  • Content type: Content-Type:application/json.

  • Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.

Parameters

Input parameters

Name

Description

[Environment]

Changes to one of the following environments.

 

Returns

Response description

Name

Description

HTTP 200

For valid requests, this call returns a HTTP 200 message and the following data in the message body:

HTTP 400

For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:

  • error: The reason for the error.
  • error_description: If available, additional information about how to retry the request.

Example: Update an environment; change custom field value

Request

POST https://codesign.venafi.example/vedsdk/Codesign/UpdateEnvironment
Authorization:Bearer 4MyGeneratedBearerTknz==
{
   "CertificateEnvironment":{
      "AllowUserKeyImport":true,
      "CustomFieldAttributes":{
         "Dirty":true,
         "Items":[
            {
               "FieldName":"EnvList",
               "Values":[
                  "Item1",
                  "item2"
               ]
            },
            {
               "FieldName":"EnvString",
               "Values":[
                  "Additional Env Info"
               ]
            }
         ]
      },
      "Dn":"\\VED\\Code Signing\\Projects\\Per User\\User Certificate Environment",
      "Guid":"{430d523d-a997-48a9-8b04-6c511e5fca8b}",
      "IPAddressRestriction":{
         "Items":[
            
         ]
      },
      "Id":618,
      "KeyTimeConstraints":{
         "Items":[
            
         ]
      },
      "KeyUseFlowDN":"\\VED\\Code Signing\\Flows\\No Restrictions",
      "PerUser":true,
      "Status":1,
      "TemplateDN":"\\VED\\Code Signing\\Environment Templates\\Certificate PerUser",
      "Type":"Code Signing Certificate Environment",
      "CASpecificAttributes":{
         "Items":[
            
         ]
      },
      "CertificateAuthorityDN":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  "\\VED\\Policy\\Code Signing\\Certificate Authority Templates\\Self-Signed Code Signing CA"
               ]
            }
         },
         "Value":"\\VED\\Policy\\Code Signing\\Certificate Authority Templates\\Self-Signed Code Signing CA"
      },
      "CertificateSubject":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"$Identity[$Sign.User$]$"
      },
      "CertificateTemplate":{
         "AllowUserKeyImport":true,
         "Dn":"\\VED\\Code Signing\\Environment Templates\\Certificate PerUser",
         "Guid":"{f0809a18-f90d-4787-97c3-efa0d67044d3}",
         "Id":624,
         "KeyUseFlowDN":"\\VED\\Code Signing\\Flows\\No Restrictions",
         "ObjectNamingPattern":"People\\$Identity[$Sign.User$]$\\$Sign.Project$ - $Sign.Environment$",
         "PerUser":true,
         "ReadOnly":true,
         "Type":"Code Signing Certificate Environment Template",
         "VisibleTo":{
            "Items":[
               
            ]
         },
         "CertificateAuthorityDN":{
            "Info":1,
            "Value":{
               "Items":[
                  "\\VED\\Policy\\Code Signing\\Certificate Authority Templates\\Self-Signed Code Signing CA"
               ]
            }
         },
         "KeyAlgorithm":{
            "Info":1,
            "Value":{
               "Items":[
                  "RSA1024",
                  "RSA2048"
               ]
            }
         },
         "KeyStorageLocation":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "TargetPolicyDN":"\\VED\\Policy\\Code Signing"
      },
      "City":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"SLC"
      },
      "KeyAlgorithm":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  "RSA1024",
                  "RSA2048"
               ]
            }
         },
         "Value":"RSA2048"
      },
      "KeyStorageLocation":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"Software"
      },
      "Organization":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"CodeSign Test"
      },
      "OrganizationalUnit":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"Imaginary Friends"
      },
      "SANEmail":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"$IdentityEmail[$Sign.User$]$"
      },
      "State":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"Utah"
      },
      "TargetStore":{
         "Info":1,
         "TemplateValues":null,
         "Value":null
      },
      "country":{
         "Info":1,
         "TemplateValues":{
            "Info":1,
            "Value":{
               "Items":[
                  
               ]
            }
         },
         "Value":"US"
      }
   }
}

Response

HTTP/1.1 200 OK
{
   "Result": 1,
   "Success": true
}