![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@types/pem
Advanced tools
Package description
@types/pem provides TypeScript type definitions for the 'pem' npm package, which is used for creating and managing PEM (Privacy Enhanced Mail) files, commonly used for SSL/TLS certificates and keys.
Create a Certificate
This feature allows you to create a self-signed certificate. The code sample demonstrates how to create a certificate that is valid for one day.
const pem = require('pem');
pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) {
if (err) {
throw err;
}
console.log(keys);
});
Read a Certificate
This feature allows you to read and extract information from a PEM-formatted certificate. The code sample shows how to read a certificate from a file and log its information.
const pem = require('pem');
pem.readCertificateInfo('path/to/certificate.pem', function (err, info) {
if (err) {
throw err;
}
console.log(info);
});
Create a Private Key
This feature allows you to create a private key. The code sample demonstrates how to generate a private key and log it.
const pem = require('pem');
pem.createPrivateKey(function (err, key) {
if (err) {
throw err;
}
console.log(key);
});
Create a CSR (Certificate Signing Request)
This feature allows you to create a Certificate Signing Request (CSR). The code sample shows how to generate a CSR for a given common name.
const pem = require('pem');
pem.createCSR({ commonName: 'example.com' }, function (err, csr) {
if (err) {
throw err;
}
console.log(csr);
});
node-forge is a native implementation of TLS (and various other cryptographic tools) in JavaScript. It provides similar functionalities for creating and managing certificates and keys, but also includes additional cryptographic utilities.
openssl-wrapper is a Node.js wrapper for the OpenSSL command line tool. It provides a higher-level API for performing various OpenSSL operations, including certificate and key management, similar to @types/pem.
pkijs is a JavaScript library for Public Key Infrastructure (PKI) and X.509 certificate management. It offers similar functionalities for handling certificates and keys, but is more focused on the PKI aspect.
Readme
npm install --save @types/pem
This package contains type definitions for pem (https://github.com/Dexus/pem).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pem.
These definitions were written by Aurelia Fenderson-Peters, Anthony Trinh, and Ruslan Arkhipau.
FAQs
TypeScript definitions for pem
The npm package @types/pem receives a total of 95,576 weekly downloads. As such, @types/pem popularity was classified as popular.
We found that @types/pem demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.