tlsSocket.exportKeyingMaterial(length, label[, context])
-
length
<number> 从密钥材料中检索的字节数 -
label
<string> 特定于应用程序的标签,通常是来自 IANA 出口商标签注册 的值。 -
context
<Buffer> 可选地提供上下文。 -
返回: <Buffer> 请求的密钥材料字节
密钥材料用于验证以防止网络协议中的不同类型的攻击,例如在 IEEE 802.1X 的规范中。
示例
const keyingMaterial = tlsSocket.exportKeyingMaterial(
128,
'client finished');
/*
keyingMaterial 的返回值示例:
<Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
74 ef 2c ... 78 more bytes>
*/
有关详细信息,请参阅 OpenSSL SSL_export_keying_material
文档。
-
length
<number> number of bytes to retrieve from keying material -
label
<string> an application specific label, typically this will be a value from the IANA Exporter Label Registry. -
context
<Buffer> Optionally provide a context. -
Returns: <Buffer> requested bytes of the keying material
Keying material is used for validations to prevent different kind of attacks in network protocols, for example in the specifications of IEEE 802.1X.
Example
const keyingMaterial = tlsSocket.exportKeyingMaterial(
128,
'client finished');
/*
Example return value of keyingMaterial:
<Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
74 ef 2c ... 78 more bytes>
*/
See the OpenSSL SSL_export_keying_material
documentation for more
information.