Skip to content

RsaHashedKeyGenParams publicExponent is not normalized to Uint8Array #59535

Description

@panva

Subsystem

Web Cryptography API

What steps will reproduce the bug?

const kp = await crypto.subtle.generateKey({
  name: 'RSA-PSS',
  hash: 'SHA-256',
  modulusLength: 2048,
  publicExponent: Buffer.from([1, 0, 1])
}, true, ['sign', 'verify']);

kp.publicKey.algorithm

// {
//   name: 'RSA-PSS',
//   modulusLength: 2048,
//   publicExponent: <Buffer 01 00 01>,
//   hash: { name: 'SHA-256' }
// }

What is the expected behavior? Why is that the expected behavior?

It is expected that publicExponent is normalized from Buffer to Uint8Array

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.webcryptoIssues and PRs related to the Web Crypto API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions