PageSourceSearch

https://steelywing.github.io/note/assets/js/9ac5cdd1.b939e2bb.js

js steelywing.github.io collected 2026-10-03 10:00:36 UTC 6,396 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[11457],{28453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>l});var i=s(96540);const r={},t=i.createContext(r);function c(e){const n=i.useContext(t);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),i.createElement(t.Provider,{value:n},e.children)}},71300:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>c,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"Note/OpenSSL/README","title":"OpenSSL","description":"File format","source":"@site/docs/Note/OpenSSL/README.md","sourceDirName":"Note/OpenSSL","slug":"/Note/OpenSSL/","permalink":"/note/Note/OpenSSL/","draft":false,"unlisted":false,"editUrl":"https://github.com/steelywing/note/edit/master/docs/Note/OpenSSL/README.md","tags":[],"version":"current","frontMatter":{},"sidebar":"note","previous":{"title":"Excel","permalink":"/note/Note/Office/Excel"},"next":{"title":"Build from source","permalink":"/note/Note/OpenSSL/Build"}}');var r=s(74848),t=s(28453);const c={},l="OpenSSL",d={},o=[{value:"File format",id:"file-format",level:2},{value:"PEM (Privacy-Enhanced Mail)",id:"pem-privacy-enhanced-mail",level:3},{value:"PKCS #12 (<code>.p12</code>)",id:"pkcs-12-p12",level:3},{value:"Convert <code>.pem</code> to <code>.p12</code>",id:"convert-pem-to-p12",level:3},{value:"Certificate signature",id:"certificate-signature",level:2},{value:"Option",id:"option",level:2},{value:"Version",id:"version",level:2},{value:"Env",id:"env",level:2},{value:"Show version",id:"show-version",level:2}];function a(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"openssl",children:"OpenSSL"})}),"\n",(0,r.jsx)(n.h2,{id:"file-format",children:"File format"}),"\n",(0,r.jsx)(n.h3,{id:"pem-privacy-enhanced-mail",children:"PEM (Privacy-Enhanced Mail)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://tools.ietf.org/html/rfc1421",children:"RFC 1421"})}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Use to store"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["X509 certificate (",(0,r.jsx)(n.code,{children:".crt"})," ",(0,r.jsx)(n.code,{children:".pem"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:["Public / private key (",(0,r.jsx)(n.code,{children:".key"})," ",(0,r.jsx)(n.code,{children:".pem"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:["Certificate signing request (",(0,r.jsx)(n.code,{children:".csr"})," ",(0,r.jsx)(n.code,{children:".pem"}),")"]}),"\n"]}),"\n",(0,r.jsxs)(n.h3,{id:"pkcs-12-p12",children:["PKCS #12 (",(0,r.jsx)(n.code,{children:".p12"}),")"]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://tools.ietf.org/html/rfc7292",children:"RFC 7292"})}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Bundle X509 full chain certificate, private key"}),"\n",(0,r.jsxs)(n.h3,{id:"convert-pem-to-p12",children:["Convert ",(0,r.jsx)(n.code,{children:".pem"})," to ",(0,r.jsx)(n.code,{children:".p12"})]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://www.openssl.org/docs/manmaster/man1/openssl-pkcs12.html",children:"Reference"})}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'openssl pkcs12 -export\n  -in <cert.{crt|pem}>\n  [-certfile <ca.crt>]\n  -inkey <private-key.pem>\n  -out <file.p12>\n  [-passout "pass:<password>"]\n  [-name "<name>"]\n'})}),"\n",(0,r.jsx)(n.h2,{id:"certificate-signature",children:"Certificate signature"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["Ref: ",(0,r.jsx)(n.a,{href:"./mq93.secure.pdf#unique_22",children:"Digital signatures in SSL/TLS"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Certificate content"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Owner DN"}),"\n",(0,r.jsx)(n.li,{children:"Owner public key"}),"\n",(0,r.jsx)(n.li,{children:"CA DN"}),"\n",(0,r.jsx)(n.li,{children:"Certificate extensions"}),"\n",(0,r.jsx)(n.li,{children:"CA signature (Append after signed)"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"// Pseudo code\n// Content exclude signature\nCASignature = encrypt(hash(Content), CAPrivateKey)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Verify signature"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"// Pseudo code\n// Content exclude signature\ndecrypt(CASignature, CAPublicKey) == hash(Content)\n"})}),"\n",(0,r.jsx)(n.h2,{id:"option",children:"Option"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Option"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"-noout"})}),(0,r.jsx)(n.td,{children:"Prevents output encoded data"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"-text"})}),(0,r.jsx)(n.td,{children:"Print the data in text form"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"-modulus"})}),(0,r.jsx)(n.td,{children:"Print the modulus of public key"})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"version",children:"Version"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"openssl version\n"})}),"\n",(0,r.jsx)(n.h2,{id:"env",children:"Env"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"OPENSSL_CONF=<openssl.cnf>\n"})}),"\n",(0,r.jsx)(n.p,{children:"Same as"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"openssl ... -config <openssl.cnf>\n"})}),"\n",(0,r.jsx)(n.h2,{id:"show-version",children:"Show version"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"openssl version\n"})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.