1<!doctype html><html lang=en dir=ltr class="blog-wrapper blog-list-page plugin-blog plugin-id-default" data-has-hydrated=false><head><meta charset=UTF-8><meta name=generator content="Docusaurus v3.10.2"><title data-rh=true>Blog | phpseclib</title><meta data-rh=true name=viewport content="width=device-width, initial-scale=1.0"/><meta data-rh=true name=twitter:card content=summary_large_image /><meta data-rh=true property=og:image content=https://phpseclib.com/img/phpseclib-social-card.jpg /><meta data-rh=true name=twitter:image content=https://phpseclib.com/img/phpseclib-social-card.jpg /><meta data-rh=true property=og:url content=https://phpseclib.com/blog /><meta data-rh=true property=og:locale content=en /><meta data-rh=true name=docusaurus_locale content=en /><meta data-rh=true name=docsearch:language content=en /><meta data-rh=true property=og:title content="Blog | phpseclib"/><meta data-rh=true name=description content=Blog /><meta data-rh=true property=og:description content=Blog /><meta data-rh=true name=docusaurus_tag content=blog_posts_list /><meta data-rh=true name=docsearch:docusaurus_tag content=blog_posts_list /><link data-rh=true rel=icon href=/img/favicon.ico /><link data-rh=true rel=canonical href=https://phpseclib.com/blog /><link data-rh=true rel=alternate href=https://phpseclib.com/blog hreflang=en /><link data-rh=true rel=alternate href=https://phpseclib.com/blog hreflang=x-default /><link data-rh=true rel=preconnect href=https://9JAHOV00P8-dsn.algolia.net crossorigin=anonymous />
1<script data-rh=true type=application/ld+json>{"@context":"https://schema.org","@id":"https://phpseclib.com/blog","@type":"Blog","blogPost":[{"@id":"https://phpseclib.com/blog/phpseclib-vs-the-world","@type":"BlogPosting","author":{"@type":"Person","description":"phpseclib creator and maintainer","name":"Jim Wigginton","url":"https://www.linkedin.com/in/jimwigginton/"},"datePublished":"2026-09-27T00:00:00.000Z","description":"Most OOP X509 implementations do something roughly analogous to subject.signedBy(issuer). Since it doesn't make any sense for the (unsigned) subject to modify the issuer the two choices this leaves you with are: return the signed subject or modify the invoker (the subject) to include the signature.","headline":"issuer.sign(subject) vs subject.signedBy(issuer) aka phpseclib vs the rest of the world","keywords":[],"mainEntityOfPage":"https://phpseclib.com/blog/phpseclib-vs-the-world","name":"issuer.sign(subject) vs subject.signedBy(issuer) aka phpseclib vs the rest of the world","url":"https://phpseclib.com/blog/phpseclib-vs-the-world"}],"description":"Blog","headline":"Blog","mainEntityOfPage":"https://phpseclib.com/blog"}</script>
1<link rel=alternate type=application/rss+xml href=/blog/rss.xml title="phpseclib RSS Feed"><link rel=alternate type=application/atom+xml href=/blog/atom.xml title="phpseclib Atom Feed"><link rel=preconnect href=https://www.google-analytics.com><link rel=preconnect href=https://www.googletagmanager.com>
vendor: 63 bytes, line 1
1<script async src="https://www.googletagmanager.com/gtag/js?id=
1G-7M7XG2FC7M
vendor: 11 bytes, line 1
1"></script>
1<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-7M7XG2FC7M",{anonymize_ip:!0})</script>
1<link rel=search type=application/opensearchdescription+xml title=phpseclib href=/opensearch.xml><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css type=text/css integrity=sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM crossorigin=anonymous><link rel=stylesheet href=/assets/css/styles.bc647b11.css />
1<script src=/assets/js/runtime~main.5f39b371.js defer></script>
1<script src=/assets/js/main.a66d34a6.js defer></script>
1</head><body><svg style="display: none;"><defs> 2<symbol id=theme-svg-external-link viewBox="0 0 24 24"><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol> 3</defs></svg>
4<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme-bfc")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||"light"),document.documentElement.setAttribute("data-theme-choice",t||"light")}(),function(){try{for(var[t,e]of new URLSearchParams(window.location.search).entries())if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script>
4<div id=__docusaurus><link rel=preload as=image href=/img/logo.svg /><link rel=preload as=image href=/img/logo-dark.svg /><link rel=preload as=image href=/img/sponsors/sovereign-tech-agency.svg /><div role=region aria-label="Skip to main content"><a class=skipToContent_fXgn href=#__docusaurus_skipToContent_fallback>Skip to main content</a></div><nav aria-label=Main class="theme-layout-navbar navbar navbar--fixed-top"><div class=navbar__inner><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded=false class="navbar__toggle clean-btn" type=button><svg width=30 height=30 viewBox="0 0 30 30" aria-hidden=true><path stroke=currentColor stroke-linecap=round stroke-miterlimit=10 stroke-width=2 d="M4 7h22M4 15h22M4 23h22"/></svg></button><a class=navbar__brand href=/><div class=navbar__logo><img src=/img/logo.svg alt=phpseclib class="themedComponent_mlkZ themedComponent--light_NVdE"/><img src=/img/logo-dark.svg alt=phpseclib class="themedComponent_mlkZ themedComponent--dark_xIcU"/></div><b class="navbar__title text--truncate">phpseclib</b></a></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><a class="navbar__item navbar__link" href=/docs/intro/why>Docs</a><a aria-current=page class="navbar__item navbar__link navbar__link--active" href=/blog>Blog</a><a href=https://github.com/phpseclib/llm-resources target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">LLM Resources<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><a href=https://stackoverflow.com/questions/tagged/phpseclib target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">Support<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><a href=https://github.com/phpseclib/phpseclib target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class=navbar__link aria-haspopup=true aria-expanded=false role=button href=/docs/intro/why>4.0</a><ul class=dropdown__menu><li><a class=dropdown__link href=/docs/intro/why>4.0</a><li><a class=dropdown__link href=/docs/3.0/intro/why>3.0</a></ul></div><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type=button disabled title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP lightToggleIcon_pyhR"><path fill=currentColor d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP darkToggleIcon_wfgR"><path fill=currentColor d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill=currentColor d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313
41.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"/></svg></button></div><div class=navbarSearchContainer_Bca1><button type=button class="DocSearch DocSearch-Button" aria-label="Search (Meta+k)" aria-keyshortcuts=Meta+k><span class=DocSearch-Button-Container><svg width=20 height=20 class=DocSearch-Search-Icon viewBox="0 0 24 24" aria-hidden=true><circle cx=11 cy=11 r=8 stroke=currentColor fill=none stroke-width=1.4 /><path d="m21 21-4.3-4.3" stroke=currentColor fill=none stroke-linecap=round stroke-linejoin=round /></svg><span class=DocSearch-Button-Placeholder>Search</span></span><span class=DocSearch-Button-Keys></span></button></div></div></div><div role=presentation class=navbar-sidebar__backdrop></div></nav><div id=__docusaurus_skipToContent_fallback class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class=row><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><div role=group><h3 class=yearGroupHeading_rMGB>2026</h3><ul class="sidebarItemList_Yudw clean-list"><li class=sidebarItem__DBe><a class=sidebarItemLink_mo7H href=/blog/phpseclib-vs-the-world>issuer.sign(subject) vs subject.signedBy(issuer)</a></ul></div></nav></aside><main class="col col--7"><article class=margin-bottom--xl><header><h2 class=title_f1Hy><a href=/blog/phpseclib-vs-the-world>issuer.sign(subject) vs subject.signedBy(issuer) aka phpseclib vs the rest of the world</a></h2><div class="container_mt6G margin-vert--md"><time datetime=2026-09-27T00:00:00.000Z>September 27, 2026</time> · <!-- -->13 min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--12 authorCol_Hf19"><div class="avatar margin-bottom--sm"><div class="avatar__intro authorDetails_lV9A"><div class=avatar__name><a href=/blog/authors/terrafrost><span class=authorName_yefp translate=no>Jim Wigginton</span></a></div><small class=authorTitle_nd0D title="phpseclib creator and maintainer">phpseclib creator and maintainer</small><div class=authorSocials_rSDt><a href=https://www.linkedin.com/in/jimwigginton/ target=_blank rel="noopener noreferrer" class=authorSocialLink_owbf title=LinkedIn><svg xmlns=http://www.w3.org/2000/svg width=1em height=1em preserveAspectRatio=xMidYMid viewBox="0 0 256 256" style=--dark:#0a66c2;--light:#ffffffe6 class="authorSocialIcon_XYv3 linkedinSvg_FCgI"><path d="M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453"/></svg></a><a href=https://github.com/terrafrost target=_blank rel="noopener noreferrer" class=authorSocialLink_owbf title=GitHub><svg xmlns=http://www.w3.org/2000/svg width=1em height=1em viewBox="0 0 256 250" preserveAspectRatio=xMidYMid style=--dark:#000;--light:#fff class="authorSocialIcon_XYv3 githubSvg_Uu4N"><path d="M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903
41 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"/></svg></a></div></div></div></div></div></header><div class=markdown><p>Most OOP X509 implementations do something roughly analogous to <code>subject.signedBy(issuer)</code>. Since it doesn't make any sense for the (unsigned) subject to modify the issuer the two choices this leaves you with are: return the signed subject or modify the invoker (the subject) to include the signature.</p> 5<p>phpseclib 4 flips this on its head. Instead of the invoker being the subject the invoker is the issuer. The subject is modified and the string that is the signature is returned. (Technically, the signature can be an array, as well, for EC / DSA objects with a signature format of Raw, but that's neither here nor there).</div><footer class="row docusaurus-mt-lg"><div class="col col--9"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class=tag_QGVx><a rel=tag title="Posts about X.509 certificates, CSRs, CRLs and related formats." class="tag_zVej tagRegular_sFm0" href=/blog/tags/x509>X.509</a><li class=tag_QGVx><a rel=tag title="Posts about creating and verifying digital signatures." class="tag_zVej tagRegular_sFm0" href=/blog/tags/signing>Signing</a><li class=tag_QGVx><a rel=tag title="Posts about why phpseclib's APIs are designed the way they are." class="tag_zVej tagRegular_sFm0" href=/blog/tags/api-design>API Design</a><li class=tag_QGVx><a rel=tag title="Posts comparing phpseclib with other libraries and languages." class="tag_zVej tagRegular_sFm0" href=/blog/tags/comparison>Comparison</a></ul></div><div class="col text--right col--3"><a aria-label="Read more about issuer.sign(subject) vs subject.signedBy(issuer) aka phpseclib vs the rest of the world" href=/blog/phpseclib-vs-the-world><b>Read more</b></a></div></footer></article><nav class=pagination-nav aria-label="Blog list page navigation"></nav></main></div></div></div><section class=wrap_SKqT aria-labelledby=special-thanks><div class=inner_wZbk><h2 id=special-thanks class=title_EM8d>Special Thanks</h2><ul class=grid_TAaK><li class=item_PSNQ><a href=https://www.sovereign.tech/tech/phpseclib target=_blank rel="noopener noreferrer" class=card_GBwS><img src=/img/sponsors/sovereign-tech-agency.svg class=logo_hDnE /></a></ul></div></section><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Docs</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/docs/intro/why>Introduction</a><li class=footer__item><a class=footer__link-item href=/docs/ssh2/connect>SSH / SFTP</a><li class=footer__item><a class=footer__link-item href=/docs/publickeys/overview>Public Key Crypto</a><li class=footer__item><a class=footer__link-item href=/docs/symmetric/overview>Symmetric Key Crypto</a><li class=footer__item><a class=footer__link-item href=/docs/file/x509>X509 / PFX / CMS / etc</a><li class=footer__item><a class=footer__link-item href=/docs/interop/overview>Interoperability</a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Support</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://phpseclib.sourceforge.net/ target=_blank rel="noopener noreferrer" class=footer__link-item>Docs (1.0 / 2.0)<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li class=footer__item><a href=https://github.com/phpseclib/llm-resources target=_blank rel="noopener noreferrer" class=footer__link-item>LLM Resources (4.0)<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li class=footer__item><a href=https://stackoverflow.com/questions/tagged/phpseclib target=_blank rel="noopener noreferrer" class=footer__link-item>Stack Overflow<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li class=footer__item><a href=https://github.com/phpseclib/phpseclib/issues target=_blank rel="noopener noreferrer" class=footer__link-item>GitHub Issues<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a></ul></div>
5<div class="theme-layout-footer-column col footer__col"><div class=footer__title>Sponsor</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://patreon.com/phpseclib target=_blank rel="noopener noreferrer" class=footer__link-item>Patreon<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li class=footer__item><a href=https://github.com/sponsors/terrafrost target=_blank rel="noopener noreferrer" class=footer__link-item>GitHub<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li class=footer__item><a href="https://sourceforge.net/donate/index.php?group_id=198487" target=_blank rel="noopener noreferrer" class=footer__link-item>PayPal<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a></ul></div></div><div class="footer__bottom text--center"><div class=footer__copyright>Copyright © 2025 Jim Wigginton. Built with Docusaurus.</div></div></div></footer></div></body>
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.