Socket
Socket
Sign inDemoInstall

node-webcrypto-ossl

Package Overview
Dependencies
5
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.1.2

1

index.d.ts

@@ -5,2 +5,3 @@ import type { CryptoKeyStorage as CoreCryptoKeyStorage } from "webcrypto-core";

readonly directory: string;
setItem(item: globalThis.CryptoKey, id?: string): Promise<string>;
}

@@ -7,0 +8,0 @@

2

package.json
{
"name": "node-webcrypto-ossl",
"version": "2.1.1",
"version": "2.1.2",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -86,4 +86,4 @@ # node-webcrypto-ossl

```javascript
const { Crypto } = require("node-webcrypto-ossl");
```js
import { Crypto } from "node-webcrypto-ossl";

@@ -113,7 +113,5 @@ const crypto = new Crypto();

```javascript
var keyStorage = webcrypto.keyStorage;
```js
// generating RSA key
crypto.subtle.generateKey({
const keys = await crypto.subtle.generateKey({
name: "RSASSA-PKCS1-v1_5",

@@ -128,15 +126,14 @@ modulusLength: 1024,

["sign", "verify"]
)
.then(function(keyPairs){
/**
* saving private RSA key to KeyStorage
* creates file ./key_storage/prvRSA-1024.json
*/
keyStorage.setItem("prvRSA-1024", keyPairs.privateKey);
})
);
/**
* saving private RSA key to KeyStorage
* creates file ./key_storage/prvRSA-1024
*/
await crypto.keyStorage.setItem(keyPairs.privateKey, "prvRSA-1024");
```
To get key from KeyStorage
```javascript
var rsaKey = webcrypto.keyStorage.getItem("prvRSA-1024");
```js
var rsaKey = await webcrypto.keyStorage.getItem("prvRSA-1024");
```

@@ -143,0 +140,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc