Skip to content

CryptoKey global already practiced but not defined. #296

Description

@panva

Every single browser implementation attaches the CryptoKey constructor to window or worker global scope. This is very useful for defensive programming when building libraries / code around web crypto, e.g. to fail early on invalid user input (when key is not an instanceof CryptoKey and wanting to offer a useful and consistent error message (unlike the implementation specific ones that often come with no information whatsoever).

I think https://w3c.github.io/webcrypto/#crypto-interface should get updated to reflect what's already the practice today and add CryptoKey alongside of the readonly crypto to WindowOrWorkerGlobalScope.

Activity

  1. annevk commented on Nov 1, 2021

    @annevk
    Member

    That already follows from https://w3c.github.io/webcrypto/#cryptokey-interface. See Web IDL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo