{
  "Id": "57df10c5-dbd9-4a9c-95c8-4b95a1b6e31e",
  "DisplayName": "Deliver-Certificate-via-Email-CorpWebServer-RSA",
  "Description": "Enroll for certificate with CorpWebServer-RSA profile and deliver resulting certificate in email using the default enrollment pattern.",
  "Key": "567",
  "KeyDisplayName": "ejbca7\\Corporate_CorpWebServer-RSA",
  "IsPublished": true,
  "WorkflowType": "Enrollment",
  "Steps": [
    {
      "Id": "e1837dd1-f571-41a8-81d3-113dcf1a0330",
      "DisplayName": "Collect Raw Certificate",
      "UniqueName": "PowerShell1",
      "ExtensionName": "PowerShell",
      "Enabled": true,
      "ConfigurationParameters": {
        "ScriptParameters": {
          "RawCertificate": "$(RawCertificate)"
        },
        "ScriptContent": "# Declare your parameter at the beginning\r\nparam(\r\n    [string] $RawCertificate\r\n)\r\n\r\n# Update certificate string with begin/end blocks\r\n$RawCertificate = \"-----BEGIN CERTIFICATE-----\"+$RawCertificate+\"-----END CERTIFICATE-----\"\r\n\r\n# Return the certificate to the workflow as a hashtable\r\n$result = @{ \"RawCertificateFormatted\" = $RawCertificate }\r\nreturn $result"
      },
      "Signals": [],
      "Conditions": [],
      "Outputs": {
        "continue": "RESTRequest1"
      }
    },
    {
      "Id": "aecdb79b-fb7c-453d-8071-116b75d21976",
      "DisplayName": "End-NOOP",
      "UniqueName": "EndNOOP",
      "ExtensionName": "NOOPStep",
      "Enabled": true,
      "ConfigurationParameters": {},
      "Signals": [],
      "Conditions": [],
      "Outputs": {}
    },
    {
      "Id": "025bca92-ce90-4ca6-8cc7-40c281893590",
      "DisplayName": "Enroll for Certificate",
      "UniqueName": "EnrollStep1",
      "ExtensionName": "EnrollStep",
      "Enabled": true,
      "ConfigurationParameters": {},
      "Signals": [],
      "Conditions": [],
      "Outputs": {
        "continue": "PowerShell1"
      }
    },
    {
      "Id": "ad1d2a16-42ab-40b4-86eb-86760edb632e",
      "DisplayName": "Get Enrollment Pattern Name",
      "UniqueName": "RESTRequest1",
      "ExtensionName": "RESTRequest",
      "Enabled": true,
      "ConfigurationParameters": {
        "Headers": {
          "x-keyfactor-requested-with": [
            "APIClient"
          ]
        },
        "DataBucketProperty": "EPResponse",
        "Verb": "GET",
        "UseBasicAuth": true,
        "BasicUsername": null,
        "BasicPassword": null,
        "URL": "https://keyfactor.keyexample.com/KeyfactorAPI/EnrollmentPatterns/$(EnrollmentPattern)",
        "ContentType": "application/json",
        "RequestContent": ""
      },
      "Signals": [],
      "Conditions": [],
      "Outputs": {
        "continue": "Email1"
      }
    },
    {
      "Id": "510c4246-2bee-4406-a2ed-aa0fc19d60ea",
      "DisplayName": "Send Certificate in Email",
      "UniqueName": "Email1",
      "ExtensionName": "Email",
      "Enabled": true,
      "ConfigurationParameters": {
        "Subject": "Certificate Enrollment Complete for $(issuedcert:cn)",
        "Message": "Hello,\n\nA certificate using the $(template) template and the $(EPResponse.Name) enrollment pattern was requested by $(requester:displayname) from $(CA) on $(subdate).\n\nThe certificate details include:\n\n<ul>\n   <li>CN: $(request:cn)</li>\n   <li>DN: $(request:dn)</li>\n   <li>SANs: $(sans)</li>\n</ul>\n\nThe certificate (without private key) is included here:\n\n<blockquote>$(RawCertificateFormatted)</blockquote>\n   \n Copy this text to a file using a text editor and save it as:\n \n<blockquote>$(request:cn).crt</blockquote>\n\nThanks!\nYour Certificate Management Tool",
        "Recipients": [
          "pkiadmins@keyexample.com"
        ]
      },
      "Signals": [],
      "Conditions": [],
      "Outputs": {
        "continue": "EndNOOP"
      }
    },
    {
      "Id": "9f7cd5b3-36f9-4579-b2e0-ffe1f26f83fc",
      "DisplayName": "Start-NOOP",
      "UniqueName": "StartNOOP",
      "ExtensionName": "NOOPStep",
      "Enabled": true,
      "ConfigurationParameters": {},
      "Signals": [],
      "Conditions": [],
      "Outputs": {
        "continue": "EnrollStep1"
      }
    }
  ],
  "DraftVersion": 1,
  "PublishedVersion": 1,
  "Enabled": true
}