Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
azure-keyvault
Advanced tools
This project provides a Node.js package for accessing keys, secrets and certificates on Azure Key Vault. Right now it supports:
npm install azure-keyvault
A sample that can be cloned and run can be found here.
Others you might want to take a look at: Soft delete, recovery, backup and restore Managed storage accounts Deploying certificates to a VM Fetching keyvault secret from a web-application during runtime with MSI
The following are some examples on how to create and consume secrets, certificates and keys. For a complete sample, please check one of the above links.
var KeyVault = require('azure-keyvault');
var msRestAzure = require('ms-rest-azure');
async function main(): Promise<void> {
const credentials = await msRestAzure.interactiveLogin();
// OR const credentials = await msRestAzure.loginWithServicePrincipalSecret("clientId", "secret", "domain");
// OR any other login method from msRestAzure.
const client = new KeyVault.KeyVaultClient(credentials);
}
main();
client.createKey(vaultUri, 'mykey', 'RSA', options).then( (keyBundle) => {
// Encrypt some plain text
return client.encrypt(keyBundle.key.kid, 'RSA-OAEP', "ciphertext");
});
// Create a certificate
client.createCertificate(vaultUri, 'mycertificate', options).then( (certificateOperation) => {
console.log(certificateOperation);
var parsedId = KeyVault.parseCertificateOperationIdentifier(certificateOperation.id);
// Poll the certificate status until it is created
var interval = setInterval( () => {
client.getCertificateOperation(parsedId.vault, parsedId.name).then( (pendingCertificate) => {
if (pendingCertificate.status.toUpperCase() === 'completed'.toUpperCase()) {
clearInterval(interval); // clear our polling function
console.log(pendingCertificate);
var parsedCertId = KeyVault.parseCertificateIdentifier(pendingCertificate.target);
client.deleteCertificate(parsedCertId.vault, parsedCertId.name).then( (deleteResponse) => {
console.log(deleteResponse);
});
}
});
});
});
FAQs
KeyVaultClient Library with typescript type definitions for node
The npm package azure-keyvault receives a total of 9,957 weekly downloads. As such, azure-keyvault popularity was classified as popular.
We found that azure-keyvault demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.