
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
macos-export-certificate-and-key
Advanced tools
Export a certificate and its corresponding private key from the MacOS default keychain
Access the macOS system certificate and key store. This module is a native addon. It will only successfully work on macOS 10.12+. No prebuilt binaries are currently provided.
exportCertificateAndPrivateKey(opts?)Export a certificate and its corresponding private key from the macOS CA store.
Valid options are:
subject: Subject line of the certificate/key as a string.thumbprint: Thumbprint of the certificate/key as a Uint8Array.
Either subject or thumbprint must be provided.This function returns a single certificate (and by default its private key) combination as a .pfx file, along with a random passphrase that has been used for encrypting the file. It will throw an exception if no relevant certificate could be found. The certificate in question can be specified either through its subject line string or its thumbprint.
When exporting, the user will be prompted to enter his password to allow keychain access.
exportSystemCertificates()Export all system certificates (no private keys).
You need to import testkeys\certificate.pfx manually into your local keychain in order for the tests to pass. The password for the file is pass.
FAQs
Export a certificate and its corresponding private key from the MacOS default keychain
The npm package macos-export-certificate-and-key receives a total of 11,429 weekly downloads. As such, macos-export-certificate-and-key popularity was classified as popular.
We found that macos-export-certificate-and-key demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 26 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.