
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@govtechsg/open-certificate
Advanced tools
**This CLI has been deprecated in favor of open-attestation CLI. Please read [OpenCerts documentation](https://docs.opencerts.io/docs/) to find out more.**
This CLI has been deprecated in favor of open-attestation CLI. Please read OpenCerts documentation to find out more.
This library supplies the schemas used for OpenCerts standards, in the form of json schemas
Using npm:
npm install @govtechsg/open-certificate
If you are writing a certificate issuer: you probably want to issue a certificate or issue multiple certificates
If you are writing a certificate verifier or viewer: you probably want to
const openCert = require("@govtechsg/open-certificate")
const exampleCert = require("exampleCert.json") // reading an example certificate file
openCert.verify(exampleCert)
This library comes with the schemas in the ./schema folder, all of them are loaded as valid schemas upon initialization.
openCert.validateSchema(exampleCert)
Certificates are considered untampered-with if they have a valid signature field. Refer to the Open Attestation library for more details on this.
openCert.verifySignature(exampleCert)
A single Certificate can be issued using the .issueCertificate(certificate) method.
Issuing a certificate in this manner will append a signature field to the certificate.
The return value of the method will be the signed certificate.
const issuedCert = openCert.issueCertificate(exampleCert)
Multiple Certificates can be issued at once with the .issueCertificates(certificate[]) method.
The return value of the method will be an array of signed certificates.
const exampleCerts = [cert1, cert2, cert3, ...]
const issuedCerts = openCert.issueCertificates(exampleCerts)
The raw certificate has salt in the fields to prevent enumeration, we provide a convenience method to retrieve the unsalted contents of the certificate using the method .certificateData(certificate)
const data = openCert.certificateData(exampleCert)
To obfuscate fields in a cert, the method .obfuscateFields(certificate, paths[]) is provided.
The paths[] parameter is simply the JSON path for the fields to be obfuscated.
The method returns the obfuscated certificate.
const obfuscatedCert = openCert.obfuscateFields(exampleCert, [
"recipient.email",
"recipient.phone"
]);
The code is written to ES6 specs with stage-3 presets and is compiled by Babel.
npm run test
npm run build
FAQs
**This CLI has been deprecated in favor of open-attestation CLI. Please read [OpenCerts documentation](https://docs.opencerts.io/docs/) to find out more.**
We found that @govtechsg/open-certificate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.