crypto.createSecretKey(key[, encoding])
key
<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding
<string>key
为字符串时的字符串编码。- 返回: <KeyObject>
创建并返回新的密钥对象,其中包含用于对称加密或 Hmac
的密钥。
key
<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding
<string> The string encoding whenkey
is a string.- Returns: <KeyObject>
Creates and returns a new key object containing a secret key for symmetric
encryption or Hmac
.