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 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: new Buffer('test', 'utf8'),
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: new Buffer('test', 'utf8'),
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 and outputs an EncryptedPrivateKeyInfo
1412
+ // encrypts a PrivateKeyInfo using a custom password and
1413
+ // outputs an EncryptedPrivateKeyInfo
1413
1414
  var encryptedPrivateKeyInfo = pki.encryptPrivateKeyInfo(
1414
- privateKeyInfo, 'password', {
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, 'password');
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 = new Buffer(forgeBuffer.getBytes(), 'binary');
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 = new Buffer();
1970
+ var nodeBuffer = Buffer.from('CAFE', 'hex');
1969
1971
  var forgeBuffer = forge.util.createBuffer(nodeBuffer.toString('binary'));
1970
1972
 
1971
1973
  // parse a URL