Repository navigation
Commit 5498ee6
crypto: add X.509 generation with CSR support
Expose callback-based generateX509Certificate() and synchronous
generateX509CertificateSync(), producing X509Certificate objects for
self-signed and issuer-signed X.509 v3 certificates. Accept grouped
distinguished names or exact subject DER, public keys, serial numbers,
validity dates, and an explicit signing digest. Reuse crypto.sign() key
inputs and RSA options, including OpenSSL STORE-backed keys.
A PKCS#10 request can supply the subject and public key instead.
Require a synchronous selectExtensions callback to accept, replace, or
amend the requested extensions. Verify the request signature before
signing the certificate, in the selected sync or async mode.
Provide typed Basic Constraints, Key Usage, Extended Key Usage, SAN,
SKI, and AKI, plus arbitrary raw extensions. Add none implicitly and
leave raw extension semantics to the caller. Copy mutable inputs
before queueing asynchronous work. Certificate trust and CA
authorization remain the caller's responsibility.
Fixes: #51169
Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #67245
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent 77e6379 commit 5498ee6
18 files changed
Lines changed: 3636 additions & 23 deletions
File tree
- deps/ncrypto
- doc/api
- lib
- internal/crypto
- src
- crypto
- test/parallel
- typings/internalBinding
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1742 | 1742 | | |
1743 | 1743 | | |
1744 | 1744 | | |
| 1745 | + | |
1745 | 1746 | | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
| 1747 | + | |
1751 | 1748 | | |
1752 | 1749 | | |
1753 | | - | |
1754 | | - | |
| 1750 | + | |
| 1751 | + | |
1755 | 1752 | | |
1756 | 1753 | | |
1757 | 1754 | | |
| |||
1770 | 1767 | | |
1771 | 1768 | | |
1772 | 1769 | | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1773 | 1779 | | |
1774 | 1780 | | |
1775 | 1781 | | |
| |||
1793 | 1799 | | |
1794 | 1800 | | |
1795 | 1801 | | |
1796 | | - | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1797 | 1809 | | |
1798 | 1810 | | |
1799 | 1811 | | |
| |||
1803 | 1815 | | |
1804 | 1816 | | |
1805 | 1817 | | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1810 | 1851 | | |
1811 | 1852 | | |
1812 | 1853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| |||
1683 | 1693 | | |
1684 | 1694 | | |
1685 | 1695 | | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
1686 | 1699 | | |
1687 | 1700 | | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
1688 | 1708 | | |
1689 | 1709 | | |
1690 | 1710 | | |
| |||
1727 | 1747 | | |
1728 | 1748 | | |
1729 | 1749 | | |
1730 | | - | |
| 1750 | + | |
1731 | 1751 | | |
1732 | 1752 | | |
1733 | 1753 | | |
| |||
0 commit comments