Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Dec 27, 2016
1 parent f536c86 commit 83fc822
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ npm install
mocha
```

## Supported algorithms

| Algorithm name | generateKey | digest | export/import | sign/verify | encrypt/decrypt | wrapKey/unwrapKey | derive |
|-------------------|-------------|---------|---------------|-------------|-----------------|-------------------|---------|
| SHA-1 | | X | | | | | |
| SHA-256 | | X | | | | | |
| SHA-384 | | X | | | | | |
| SHA-512 | | X | | | | | |
| RSASSA-PKCS1-v1_5 | X | | X | X | | | |
| RSA-PSS | X | | X | X | | | |
| RSA-OAEP | X | | X | | X | X | |
| AES-CBC | X | | X | | X | X | |
| AES-GCM | X | | X | | X | X | |
| AES-KW | X | | X | | | X | |
| ECDSA | X | | X | X | | | |
| ECDH | X | | X | | | | X |
| HMAC | X | | X | X | | | |
| PBKDF2 | | | X | | | | X |

## KeyStorage

To use KeyStorage you shoud init WebCrypto with `directory` option. If `directory` option is missing then `keyStorage` is `null`
Expand Down
4 changes: 2 additions & 2 deletions test/pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ context("WebCrypto", () => {
context("deriveBits", () => {
[8, 16, 128, 256, 512].forEach(length => {
it(`lenght:${length}`, done => {
webcrypto.subtle.importKey("raw", new Buffer("password"), "pbkdf2", true, ["deriveBits"])
webcrypto.subtle.importKey("raw", new Buffer("password"), "pbkdf2", false, ["deriveBits"])
.then(key => {
assert.equal(!!key, true);
return webcrypto.subtle.deriveBits(
Expand All @@ -51,7 +51,7 @@ context("WebCrypto", () => {
context(name, () => {
[128, 192, 256].forEach(length => {
it(`length:${length}`, done => {
webcrypto.subtle.importKey("raw", new Buffer("password"), "pbkdf2", true, ["deriveKey"])
webcrypto.subtle.importKey("raw", new Buffer("password"), "pbkdf2", false, ["deriveKey"])
.then(key => {
assert.equal(!!key, true);
return webcrypto.subtle.deriveKey(
Expand Down

0 comments on commit 83fc822

Please sign in to comment.