You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -79,7 +82,7 @@ As specified in [§23.3](https://www.w3.org/TR/WebCryptoAPI/#EcdsaParams-diction
79
82
80
83
| Field | Type | Description |
81
84
| :---- | :--- | :---------- |
82
-
| Hash |`string`| The hash algorithm to use. See the supported [hash algorithms](#hash-algorithms)|
85
+
| Hash |`string`| The hash algorithm to use. See the supported [hash algorithms](#parameter-definitions-4)|
83
86
84
87
##### KeyGenParams
85
88
@@ -220,7 +223,7 @@ As specified in [§29.5](https://www.w3.org/TR/WebCryptoAPI/#hmac-keygen-params)
220
223
221
224
| Field | Type | Description |
222
225
| :---- | :--- | :---------- |
223
-
| Hash |`string`| The inner hash function to use. See the supported [hash algorithms](#hash-algorithms). |
226
+
| Hash |`string`| The inner hash function to use. See the supported [hash algorithms](#parameter-definitions-4). |
224
227
| Length |`uint64`| The length (in bits) of the key to generate. If unspecified, the recommended length will be used, which is the size of the associated hash function's block size. |
225
228
226
229
##### ImportParams
@@ -229,7 +232,7 @@ As specified in [§29.3](https://www.w3.org/TR/WebCryptoAPI/#hmac-importparams)
229
232
230
233
| Field | Type | Description |
231
234
| :---- | :--- | :---------- |
232
-
| Hash |`string`| The inner hash function to use. See the supported [hash algorithms](#hash-algorithms). |
235
+
| Hash |`string`| The inner hash function to use. See the supported [hash algorithms](#parameter-definitions-4). |
233
236
| Length |`uint64`| The length (in bits) of the key. |
234
237
235
238
#### Examples
@@ -472,7 +475,7 @@ As specified in [§20.4](https://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyGenPara
472
475
473
476
| Field | Type | Description |
474
477
| :---- | :--- | :---------- |
475
-
| Hash |`string`| The [hash algorithm](#hash-algorithms) to use. |
478
+
| Hash |`string`| The [hash algorithm](#parameter-definitions-4) to use. |
476
479
| ModulusLength |`uint64`| The length, in bits, of the RSA modulus. |
477
480
| PublicExponent |`*big.Int`| The RSA public exponent. |
478
481
@@ -482,48 +485,67 @@ As specified in [§20.7](https://www.w3.org/TR/WebCryptoAPI/#RsaHashedImportPara
482
485
483
486
| Field | Type | Description |
484
487
| :---- | :--- | :---------- |
485
-
| Hash |`string`| The [hash algorithm](#hash-algorithms) to use. |
488
+
| Hash |`string`| The [hash algorithm](#parameter-definitions-4) to use. |
486
489
487
490
488
-
## SHA
491
+
###SHA
489
492
490
493
The **SHA** algorithm is the implementation of operations described in [§30](https://www.w3.org/TR/WebCryptoAPI/#sha) of the W3C specification.
491
494
492
-
The implementation in this library uses Go's `io.Reader` as the input to the `digest` method.
Params: &sha.Params{}, // we use *sha.Params so we can register the algorithm without using a blank import
537
+
}, []byte("test"))
508
538
509
539
if err != nil {
510
540
panic(err)
511
541
}
512
542
513
543
// do something with hash
544
+
fmt.Println(hex.EncodeToString(hash))
514
545
}
546
+
515
547
```
516
548
517
549
## Contributing
518
550
519
-
If you have found a bug or would like to see new features, please create a new issue in this repository. If there is an issue that poses a security risk, please refrain from posting the issue publicly and contact [[email protected]](mailto://[email protected]) instead.
520
-
521
-
## Apendix
522
-
523
-
### Hash Algorithms
524
-
525
-
Unless otherwise specified by a particular algorithm, the supported hash algorithms are
526
-
-`SHA-1`
527
-
-`SHA-256`
528
-
-`SHA-384`
529
-
-`SHA-512`
551
+
If you have found a bug or would like to see new features, please create a new issue in this repository. If there is an issue that poses a security risk, please refrain from posting the issue publicly and contact [[email protected]](mailto://[email protected]) instead.
0 commit comments