{"id":1443,"date":"2021-04-20T07:27:49","date_gmt":"2021-04-19T19:27:49","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=1443"},"modified":"2021-04-20T07:27:49","modified_gmt":"2021-04-19T19:27:49","slug":"private-certification-authority-ca","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=1443","title":{"rendered":"Private Certification Authority (CA)"},"content":{"rendered":"<h2>Create the private key and certificate pair.<\/h2>\n<ol>\n<li>\n<p>Download <strong>OpenSSL<\/strong> binaries from the following link if you are using windows:<\/p>\n<p><a href=\"https:\/\/slproweb.com\/products\/Win32OpenSSL.html\">https:\/\/slproweb.com\/products\/Win32OpenSSL.html<\/a><\/p>\n<\/li>\n<li>\n<p>Create a <strong>ca.cnf<\/strong> file using the following template:<\/p>\n<pre><code>[ req ]\ndefault_bits        = 2048\ndefault_keyfile     = private.pem\ndistinguished_name  = subject\nreq_extensions      = req_ext\nx509_extensions     = x509_ext\nstring_mask         = utf8only\n\n# The Subject DN can be formed using X501 or RFC 4514 (see RFC 4519 for a description).\n#   Its sort of a mashup. For example, RFC 4514 does not provide emailAddress.\n[ subject ]\ncountryName         = Country Name (2 letter code)\ncountryName_default     = &lt;2_LETTER_COUNTRY_CODE&gt;\n\nstateOrProvinceName     = State or Province Name (full name)\nstateOrProvinceName_default = &lt;STATE_NAME&gt;\n\nlocalityName            = Locality Name (eg, city)\nlocalityName_default        = &lt;CITY_NAME&gt;\n\norganizationName         = Organization Name (eg, company)\norganizationName_default    = &lt;ORGANIZATION_NAME&gt;\n\norganizationalUnitName         = Organizational Unit (eg, section)\norganizationalUnitName_default = &lt;ORGANIZATIONAL_UNIT&gt;\n\n# Use a friendly name here because it's presented to the user. The server's DNS\n#   names are placed in Subject Alternate Names. Plus, DNS names here is deprecated\n#   by both IETF and CA\/Browser Forums. If you place a DNS name here, then you\n#   must include the DNS name in the SAN too (otherwise, Chrome and others that\n#   strictly follow the CA\/Browser Baseline Requirements will fail).\ncommonName          = Common Name (e.g. server FQDN or YOUR name)\ncommonName_default      = &lt;YOUR_NAME&gt;\n\nemailAddress            = Email Address\nemailAddress_default        = &lt;YOUR_EMAIL_ADDR&gt;\n\n# Section x509_ext is used when generating a self-signed certificate. I.e., openssl req -x509 ...\n[ x509_ext ]\n\nsubjectKeyIdentifier        = hash\nauthorityKeyIdentifier    = keyid,issuer\n\nbasicConstraints        = CA:TRUE\nkeyUsage            = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyCertSign, cRLSign\nnsComment           = \"Private CA\"\n\n# Section req_ext is used when generating a certificate signing request. I.e., openssl req ...\n[ req_ext ]\n\nsubjectKeyIdentifier        = hash\n\nbasicConstraints        = CA:true\nkeyUsage            = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyCertSign, cRLSign\nnsComment           = \"Private CA\"<\/code><\/pre>\n<p>Replace the following fields on the template:<\/p>\n<table>\n<thead>\n<tr>\n<th>Field Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2_LETTER_COUNTRY_CODE<\/td>\n<td>The two letter code of your country.<\/td>\n<\/tr>\n<tr>\n<td>STATE_NAME<\/td>\n<td>The name of your state.<\/td>\n<\/tr>\n<tr>\n<td>CITY_NAME<\/td>\n<td>The name of your city.<\/td>\n<\/tr>\n<tr>\n<td>ORGANIZATION_NAME<\/td>\n<td>The name of your organization.<\/td>\n<\/tr>\n<tr>\n<td>ORGANIZATIONAL_UNIT<\/td>\n<td>The name of your section in the organization.<\/td>\n<\/tr>\n<tr>\n<td>YOUR_NAME<\/td>\n<td>Your full name or anything that represents you as a CA.<\/td>\n<\/tr>\n<tr>\n<td>YOUR_EMAIL_ADDR<\/td>\n<td>Your email address.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Example:<\/p>\n<pre><code>[ req ]\ndefault_bits        = 2048\ndefault_keyfile     = private.pem\ndistinguished_name  = subject\nreq_extensions      = req_ext\nx509_extensions     = x509_ext\nstring_mask         = utf8only\n\n# The Subject DN can be formed using X501 or RFC 4514 (see RFC 4519 for a description).\n#   Its sort of a mashup. For example, RFC 4514 does not provide emailAddress.\n[ subject ]\ncountryName         = Country Name (2 letter code)\ncountryName_default     = NZ\n\nstateOrProvinceName     = State or Province Name (full name)\nstateOrProvinceName_default = Wellington\n\nlocalityName            = Locality Name (eg, city)\nlocalityName_default        = Wellington\n\norganizationName         = Organization Name (eg, company)\norganizationName_default    = My Company\n\norganizationalUnitName         = Organizational Unit (eg, section)\norganizationalUnitName_default = IT Department\n\n# Use a friendly name here because it's presented to the user. The server's DNS\n#   names are placed in Subject Alternate Names. Plus, DNS names here is deprecated\n#   by both IETF and CA\/Browser Forums. If you place a DNS name here, then you\n#   must include the DNS name in the SAN too (otherwise, Chrome and others that\n#   strictly follow the CA\/Browser Baseline Requirements will fail).\ncommonName          = Common Name (e.g. server FQDN or YOUR name)\ncommonName_default      = Ronaldo Webb CA APR 2021\n\nemailAddress            = Email Address\nemailAddress_default        = ron@ronella.xyz\n\n# Section x509_ext is used when generating a self-signed certificate. I.e., openssl req -x509 ...\n[ x509_ext ]\n\nsubjectKeyIdentifier        = hash\nauthorityKeyIdentifier    = keyid,issuer\n\nbasicConstraints        = CA:TRUE\nkeyUsage            = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyCertSign, cRLSign\nnsComment           = \"Private CA\"\n\n# Section req_ext is used when generating a certificate signing request. I.e., openssl req ...\n[ req_ext ]\n\nsubjectKeyIdentifier        = hash\n\nbasicConstraints        = CA:true\nkeyUsage            = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyCertSign, cRLSign\nnsComment           = \"Private CA\"<\/code><\/pre>\n<\/li>\n<li>\n<p>Generate a <strong>private key<\/strong> using the following command:<\/p>\n<pre><code>openssl genrsa -out ca.key.pem 2048<\/code><\/pre>\n<\/li>\n<li>\n<p>Generate a <strong>certificate<\/strong> with a validity of <strong>10 years<\/strong> from the private key using the following command:<\/p>\n<pre><code>openssl req -x509 -sha256 -new -nodes -key ca.key.pem -days 3650 -out ca.cert.crt -config ca.cnf<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>Viewing the generated certificate<\/h2>\n<ol>\n<li>\n<p>View the generated certificate using the following command:<\/p>\n<pre><code>openssl x509 -in ca.cert.crt -text<\/code><\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Create the private key and certificate pair. Download OpenSSL binaries from the following link if you are using windows: https:\/\/slproweb.com\/products\/Win32OpenSSL.html Create a ca.cnf file using the following template: [ req ] default_bits = 2048 default_keyfile = private.pem distinguished_name = subject req_extensions = req_ext x509_extensions = x509_ext string_mask = utf8only # The Subject DN can be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1443"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1443"}],"version-history":[{"count":1,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions"}],"predecessor-version":[{"id":1444,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions\/1444"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}