Web Crypto: importKey

This page shows the use of the importKey() function of the Web Crypto API. It contains four separate examples, one for each import format supported:

Each example has the same structure: you get a message a button labeled "Import Key".

If you click "Import Key" then the example imports a particular key:

A new button is then displayed, labeled "Sign" or "Encrypt", depending on the key that was imported. You can click it to use the imported key to perform the appropriate operation and display the result.

Raw

Ciphertext:

PKCS #8

Signature:

SubjectPublicKeyInfo

Ciphertext:

JSON Web Key

Signature: