Oslo

RSASSAPSS

Helper for RSASSA-PSS.

Constructor

function constructor(hash: SHAHash): this;

Parameters

  • hash

Method

Example

import { RSASSAPSS } from "oslo/crypto";

const ps256 = new RSASSAPSS("SHA-256");

const { publicKey, privateKey } = await ps256.generateKeyPair();
const data = new TextEncoder().encode("hello, world");

const signature = await ps256.sign(privateKey, data);

const validSignature = await ps256.verify(publicKey, signature, data);