node-forge 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +10 -8
- package/dist/forge.all.min.js +1 -1
- package/dist/forge.min.js +1 -1
- package/lib/aes.js +4 -4
- package/lib/asn1-validator.js +91 -0
- package/lib/asn1.js +1 -1
- package/lib/ed25519.js +81 -5
- package/lib/oids.js +7 -0
- package/lib/pbkdf2.js +2 -2
- package/lib/pkcs12.js +1 -1
- package/lib/tls.js +2 -2
- package/lib/util.js +31 -24
- package/lib/x509.js +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
Forge ChangeLog
|
|
2
2
|
===============
|
|
3
3
|
|
|
4
|
+
## 0.9.0 - 2019-09-04
|
|
5
|
+
|
|
6
|
+
### Added
|
|
7
|
+
- Add ed25519.publicKeyFromAsn1 and ed25519.privateKeyFromAsn1 APIs.
|
|
8
|
+
- A few OIDs used in EV certs.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Improve ed25519 NativeBuffer check.
|
|
12
|
+
|
|
13
|
+
## 0.8.5 - 2019-06-18
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Remove use of `const`.
|
|
17
|
+
|
|
18
|
+
## 0.8.4 - 2019-05-22
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Replace all instances of Node.js `new Buffer` with `Buffer.from` and `Buffer.alloc`.
|
|
22
|
+
|
|
23
|
+
## 0.8.3 - 2019-05-15
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- Use basic character set for code.
|
|
27
|
+
|
|
4
28
|
## 0.8.2 - 2019-03-18
|
|
5
29
|
|
|
6
30
|
### Fixed
|
package/README.md
CHANGED
|
@@ -904,7 +904,7 @@ var signature = ED25519.sign({
|
|
|
904
904
|
// sign a message passed as a buffer
|
|
905
905
|
var signature = ED25519.sign({
|
|
906
906
|
// also accepts a forge ByteBuffer or Uint8Array
|
|
907
|
-
message:
|
|
907
|
+
message: Buffer.from('test', 'utf8'),
|
|
908
908
|
privateKey: privateKey
|
|
909
909
|
});
|
|
910
910
|
|
|
@@ -930,7 +930,7 @@ var verified = ED25519.verify({
|
|
|
930
930
|
// sign a message passed as a buffer
|
|
931
931
|
var verified = ED25519.verify({
|
|
932
932
|
// also accepts a forge ByteBuffer or Uint8Array
|
|
933
|
-
message:
|
|
933
|
+
message: Buffer.from('test', 'utf8'),
|
|
934
934
|
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string
|
|
935
935
|
signature: signature,
|
|
936
936
|
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string
|
|
@@ -1409,15 +1409,17 @@ var privateKeyInfo = pki.wrapRsaPrivateKey(rsaPrivateKey);
|
|
|
1409
1409
|
// convert a PKCS#8 ASN.1 PrivateKeyInfo to PEM
|
|
1410
1410
|
var pem = pki.privateKeyInfoToPem(privateKeyInfo);
|
|
1411
1411
|
|
|
1412
|
-
// encrypts a PrivateKeyInfo
|
|
1412
|
+
// encrypts a PrivateKeyInfo using a custom password and
|
|
1413
|
+
// outputs an EncryptedPrivateKeyInfo
|
|
1413
1414
|
var encryptedPrivateKeyInfo = pki.encryptPrivateKeyInfo(
|
|
1414
|
-
privateKeyInfo, '
|
|
1415
|
+
privateKeyInfo, 'myCustomPasswordHere', {
|
|
1415
1416
|
algorithm: 'aes256', // 'aes128', 'aes192', 'aes256', '3des'
|
|
1416
1417
|
});
|
|
1417
1418
|
|
|
1418
|
-
// decrypts an ASN.1 EncryptedPrivateKeyInfo
|
|
1419
|
+
// decrypts an ASN.1 EncryptedPrivateKeyInfo that was encrypted
|
|
1420
|
+
// with a custom password
|
|
1419
1421
|
var privateKeyInfo = pki.decryptPrivateKeyInfo(
|
|
1420
|
-
encryptedPrivateKeyInfo, '
|
|
1422
|
+
encryptedPrivateKeyInfo, 'myCustomPasswordHere');
|
|
1421
1423
|
|
|
1422
1424
|
// converts an EncryptedPrivateKeyInfo to PEM
|
|
1423
1425
|
var pem = pki.encryptedPrivateKeyToPem(encryptedPrivateKeyInfo);
|
|
@@ -1961,11 +1963,11 @@ bytes.getBytes(/* count */);
|
|
|
1961
1963
|
// convert a forge buffer into a Node.js Buffer
|
|
1962
1964
|
// make sure you specify the encoding as 'binary'
|
|
1963
1965
|
var forgeBuffer = forge.util.createBuffer();
|
|
1964
|
-
var nodeBuffer =
|
|
1966
|
+
var nodeBuffer = Buffer.from(forgeBuffer.getBytes(), 'binary');
|
|
1965
1967
|
|
|
1966
1968
|
// convert a Node.js Buffer into a forge buffer
|
|
1967
1969
|
// make sure you specify the encoding as 'binary'
|
|
1968
|
-
var nodeBuffer =
|
|
1970
|
+
var nodeBuffer = Buffer.from('CAFE', 'hex');
|
|
1969
1971
|
var forgeBuffer = forge.util.createBuffer(nodeBuffer.toString('binary'));
|
|
1970
1972
|
|
|
1971
1973
|
// parse a URL
|