Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oslo

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oslo - npm Package Compare versions

Comparing version 0.10.4 to 0.11.0

2

dist/crypto/rsa.d.ts

@@ -16,4 +16,4 @@ import type { KeyPair } from "./index.js";

sign(privateKey: ArrayBufferLike, data: ArrayBufferLike): Promise<ArrayBuffer>;
generateKey(modulusLength?: 2048 | 4096): Promise<KeyPair>;
generateKeyPair(modulusLength?: 2048 | 4096): Promise<KeyPair>;
}
export {};

@@ -75,3 +75,3 @@ export class RSASSAPKCS1v1_5 {

}
async generateKey(modulusLength) {
async generateKeyPair(modulusLength) {
const cryptoKeyPair = await crypto.subtle.generateKey({

@@ -78,0 +78,0 @@ name: "RSA-PSS",

{
"name": "oslo",
"type": "module",
"version": "0.10.4",
"version": "0.11.0",
"description": "A collection of auth-related utilities",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -81,6 +81,6 @@ # `oslo`

const es256 = new ECDSA("SHA-256", "P-256");
const key = await es256.generateKey();
const { privateKey, publicKey } = await es256.generateKeyPair();
const data = new TextEncoder().encode("Hello world");
const signature = await es256.sign(key, data);
const validSignature = await es256.verify(key, signature, data);
const signature = await es256.sign(privateKey, data);
const validSignature = await es256.verify(publicKey, signature, data);
```

@@ -92,6 +92,6 @@

const rs256 = new RSASSAPKCS1v1_5("SHA-256");
const key = await rs256.generateKey();
const { privateKey, publicKey } = await rs256.generateKeyPair();
const data = new TextEncoder().encode("Hello world");
const signature = await rs256.sign(key, data);
const validSignature = await rs256.verify(key, signature, data);
const signature = await rs256.sign(privateKey, data);
const validSignature = await rs256.verify(publicKey, signature, data);
```

@@ -102,7 +102,7 @@

const rsaPSS256 = new RSAPSS("SHA-256");
const key = await rsaPSS256.generateKey();
const ps256 = new RSAPSS("SHA-256");
const { privateKey, publicKey } = await ps256.generateKeyPair();
const data = new TextEncoder().encode("Hello world");
const signature = await rsaPSS256.sign(key, data);
const validSignature = await rsaPSS256.verify(key, signature, data);
const signature = await ps256.sign(privateKey, data);
const validSignature = await ps256.verify(publicKey, signature, data);
```

@@ -109,0 +109,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc