{"id":2407,"date":"2014-05-16T11:00:17","date_gmt":"2014-05-16T15:00:17","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=2407"},"modified":"2014-11-13T12:26:26","modified_gmt":"2014-11-13T17:26:26","slug":"certencoded","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/2407\/certencoded\/","title":{"rendered":"CERTENCODED: How to Script your Certificates"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nWhen dealing with certificates in SQL Server we sometimes need to be able to copy a specific certificate from one database to another. For example, when using certificates for permission management, we often need the same certificate to exist in the user database as well as in <span class=\"tt\">master<\/span>.\n<\/p>\n<p>\nA few days ago I wrote about how to create a <a href=\"http:\/\/sqlity.net\/en\/2379\/backup-certificate\/\">backup of your certificate<\/a>. To copy a certificate you can certainly create a backup and then restore it to another database. In fact, that is the only way to do it in SQL Server versions before SQL 2012. However, in SQL 2012 Microsoft introduced the capability to script out certificates. In this article, I am going to show you how to use that new feature.\n<\/p>\n<h3>CERTENCODED in Action<\/h3>\n<p>\nScripting a certificate through SQL Server Management Studio is not (yet) possible. Instead we have to generate the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement ourselves. For that we can use the <span class=\"tt\">CERTENCODED<\/span> built-in function. <span class=\"tt\">CERTENCODED<\/span> takes one parameter, the <span class=\"tt\">certificate_id<\/span> of the certificate we want to script, and returns a <span class=\"tt\">VARBINARY<\/span> value that contains all the public information of the certificate, including the public key.\n<\/p>\n<p>\nLet us look at an example. First, we need a certificate to script:\n<\/p>\n<div>\n[sql]\nIF(CERT_ID('ACertificate') IS NOT NULL) DROP CERTIFICATE ACertificate;<br \/>\nGO<br \/>\nCREATE CERTIFICATE ACertificate WITH SUBJECT = 'A Subject';<br \/>\n[\/sql]\n<\/div>\n<p>\nThis snippet uses a <a href=\"http:\/\/sqlity.net\/en\/2395\/cert_id\/\">conditional drop<\/a> technique to first clean up. Then it creates a <a href=\"http:\/\/sqlity.net\/en\/2375\/create-certificate\/\">simple certificate<\/a> that is protected by the <a href=\"http:\/\/sqlity.net\/en\/2373\/create-database-master-key\/\">database master key<\/a>.\n<\/p>\n<p>\nWith the certificate in place, we can now use the <span class=\"tt\">CERTENCODED<\/span> function:\n<\/p>\n<div>\n[sql]\nSELECT CERTENCODED(CERT_ID('ACertificate'));<br \/>\n[\/sql]\n<\/div>\n<p>\nAs <span class=\"tt\">CERTENCODED<\/span> takes the <span class=\"tt\">certificate_id<\/span> and not the name, we have to use the <a href=\"http:\/\/sqlity.net\/en\/2395\/cert_id\/\"><span class=\"tt\">CERT_ID<\/span> function<\/a> to get to that value.\n<\/p>\n<p>\nThe output of <span class=\"tt\">CERTENCODED<\/span> is a lengthy <span class=\"tt\">VARBINARY<\/span> value:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/CERTENCODED_in_action.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/CERTENCODED_in_action.jpg\" alt=\"CERTENCODED in Action.\" title=\"CERTENCODED in Action.\" width=\"768\" height=\"479\" class=\"aligncenter size-full wp-image-2409\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/CERTENCODED_in_action.jpg 768w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/CERTENCODED_in_action-300x187.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/CERTENCODED_in_action-150x93.jpg 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>\n<\/p>\n<p>\nNow we have a binary representation of our certificate. The next step is to turn that value into a certificate again. For that we can use yet another variation of the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement.\n<\/p>\n<h3>CREATE CERTIFICATE FROM BINARY<\/h3>\n<p>\nWe have already seen two ways to create a certificate with different forms of the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement. The first form is the default. It <a href=\"http:\/\/sqlity.net\/en\/2375\/create-certificate\/\">generates a new certificate<\/a> based on the values provided. The second form takes a DER formatted file following the X.509 standard as input and can be used to <a href=\"http:\/\/sqlity.net\/en\/2384\/restore-certificate\/\">restore a certificate backup<\/a>.\n<\/p>\n<p>\nNow it is time to look at the third form of the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement. <span class=\"tt\">CREATE CERTIFICATE<\/span> has a <span class=\"tt\">FROM BINARY<\/span> clause that you can use to create a certificate for a binary value. The syntax looks like this:\n<\/p>\n<div>\n[sql]\nCREATE CERTIFICATE [ACertificate] FROM BINARY = 0x308201AB30820114A003020102021035C0FB3E31F2929742E56FA4A197CC31300D06092A864886F70D01010505003014311230100603550403130941205375626A656374301E170D3134303531353137333331355A170D3135303531353137333331355A3014311230100603550403130941205375626A65637430819F300D06092A864886F70D010101050003818D00308189028181008A14AC241A0103E8BDBAD7AC3545AD0D5E11EC320CA7AED2F18BC001D42A3E4F35D0F67D69EF1E4CEF2281C773A3C916224761044445FA765F235C190E11BF9900961349194B5CE114B4ACA387F80ADDD92595AF8E020789C508BA64AA417850C40F266E09CA017AFF9273FD71FEDA3CA8B0FE6351998B4EFE65E50039381C4B0203010001300D06092A864886F70D010105050003818100108D1338D10F80FB63D70807B48942DAE4A4DC7648E2316D8F46FA12B60983EFD96900DC92934C0E1DFF185096A24468C6BC658E2D6FB32FE3C95DF5E70B07DFB476D287F65CD9DA1516F3F7EAB323142F30300386823EB6D72319BEDE748C21A552106CC9818817895078980276C56FCE42ACA9B66AE4AC6097E9D09179A875;<br \/>\n[\/sql]\n<\/div>\n<p>\nYou just specify the certificate name and the binary value that you got for example by using the <span class=\"tt\">CERTENCODED<\/span> function. The binary value has to be specified as a constant. You cannot directly create a certificate from a value in a variable.\n<\/p>\n<h3>Scripting a Certificate<\/h3>\n<p>\nNow that we have the two parts that are required to script a certificate, we can build a query to return the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement for a specific certificate:\n<\/p>\n<div>\n[sql]\nSELECT 'CREATE CERTIFICATE ' +<br \/>\n       QUOTENAME(C.name) +<br \/>\n       ' FROM BINARY = ' +<br \/>\n       CONVERT(NVARCHAR(MAX),CERTENCODED(C.certificate_id),1) +<br \/>\n       ';' AS create_cmd<br \/>\n  FROM sys.certificates AS C<br \/>\n WHERE C.name = 'ACertificate';<br \/>\n[\/sql]\n<\/div>\n<p>\nThis query returns the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement for the specified certificate. However, as it is a query against the <span class=\"tt\">sys.certificates<\/span> catalog view, you can certainly use it to script out all certificates too. You just have to remove the <span class=\"tt\">WHERE<\/span> clause.\n<\/p>\n<p>\nIn the above single-certificate form the result of the query looks like this:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg\" alt=\"A generated CREATE CERTIFICATE statement.\" title=\"A generated CREATE CERTIFICATE statement.\" width=\"768\" height=\"479\" class=\"aligncenter size-full wp-image-2408\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg 768w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE-300x187.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE-150x93.jpg 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>\n<\/p>\n<h3>What About The Private Key?<\/h3>\n<p>\nThis entire article is only concerned with the public parts of the certificate. To also script and create the private key, additional functionality is required. However, in most situations, which require the same certificate in more than one database, copying just the public key is enough. How to also include the private key is topic of a later article.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nBesides of generating a new certificate and creating one base on a file, the <span class=\"tt\">CREATE CERTIFICATE<\/span> statement can be used to create a certificate based on a binary value. The <span class=\"tt\">CERTENCODED<\/span> function can be used to generate such a binary value for an existing certificate.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The ability to copy certificates from one database to another is often an important requirement in SQL Server security management. Read on to learn how to do just that effectively.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/2407\/certencoded\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":2408,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[69,32,5,34],"tags":[49,273,38,15],"class_list":["post-2407","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backup","category-cryptography","category-general","category-security","tag-certificates","tag-cryptography","tag-security-2","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CERTENCODED: How to Script your Certificates - sqlity.net<\/title>\n<meta name=\"description\" content=\"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/2407\/certencoded\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CERTENCODED: How to Script your Certificates - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/2407\/certencoded\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2014-05-16T15:00:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T17:26:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"479\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"CERTENCODED: How to Script your Certificates\",\"datePublished\":\"2014-05-16T15:00:17+00:00\",\"dateModified\":\"2014-11-13T17:26:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/\"},\"wordCount\":910,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/a_generated_CREATE_CERTIFICATE.jpg\",\"keywords\":[\"Certificates\",\"Cryptography\",\"security\",\"SQL Server\"],\"articleSection\":[\"Backup\",\"Cryptography\",\"General\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/\",\"name\":\"CERTENCODED: How to Script your Certificates - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/a_generated_CREATE_CERTIFICATE.jpg\",\"datePublished\":\"2014-05-16T15:00:17+00:00\",\"dateModified\":\"2014-11-13T17:26:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/a_generated_CREATE_CERTIFICATE.jpg\",\"contentUrl\":\"https:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/a_generated_CREATE_CERTIFICATE.jpg\",\"width\":768,\"height\":479,\"caption\":\"A generated CREATE CERTIFICATE statement.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2407\\\/certencoded\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CERTENCODED: How to Script your Certificates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CERTENCODED: How to Script your Certificates - sqlity.net","description":"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sqlity.net\/en\/2407\/certencoded\/","og_locale":"en_US","og_type":"article","og_title":"CERTENCODED: How to Script your Certificates - sqlity.net","og_description":"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.","og_url":"https:\/\/sqlity.net\/en\/2407\/certencoded\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2014-05-16T15:00:17+00:00","article_modified_time":"2014-11-13T17:26:26+00:00","og_image":[{"width":768,"height":479,"url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","type":"image\/jpeg"}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"CERTENCODED: How to Script your Certificates","datePublished":"2014-05-16T15:00:17+00:00","dateModified":"2014-11-13T17:26:26+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/"},"wordCount":910,"commentCount":1,"image":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","keywords":["Certificates","Cryptography","security","SQL Server"],"articleSection":["Backup","Cryptography","General","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/2407\/certencoded\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/","url":"https:\/\/sqlity.net\/en\/2407\/certencoded\/","name":"CERTENCODED: How to Script your Certificates - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","datePublished":"2014-05-16T15:00:17+00:00","dateModified":"2014-11-13T17:26:26+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"The ability to copy certificates from one DB to another is often a requirement in SQL Server security management. Read on to learn how to do it effectively.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/2407\/certencoded\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#primaryimage","url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","contentUrl":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","width":768,"height":479,"caption":"A generated CREATE CERTIFICATE statement."},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/2407\/certencoded\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"CERTENCODED: How to Script your Certificates"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-CP","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/05\/a_generated_CREATE_CERTIFICATE.jpg","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=2407"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2407\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media\/2408"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=2407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=2407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=2407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}