Build
Docs
Reference
Guides
Blog
Discord
/
node:crypto
/
KeyObject
/
toCryptoKey
M
toCryptoKey
Search the reference...
/
Build
Docs
Reference
Guides
Blog
Discord
/
node:crypto
/
KeyObject
/
toCryptoKey
M
toCryptoKey
method
crypto.KeyObject.toCryptoKey
toCryptoKey
(
algorithm
:
AlgorithmIdentifier
|
RsaHashedImportParams
|
EcKeyImportParams
|
HmacImportParams
,
extractable
:
boolean
,
keyUsages
:
readonly
KeyUsage
[]
)
:
CryptoKey
;
Converts a
KeyObject
instance to a
CryptoKey
.
Referenced types
type
AlgorithmIdentifier
=
Algorithm
|
string
interface
RsaHashedImportParams
hash
:
AlgorithmIdentifier
name
:
string
interface
EcKeyImportParams
name
:
string
namedCurve
:
string
interface
HmacImportParams
hash
:
AlgorithmIdentifier
length
?
:
number
name
:
string
interface
CryptoKey
readonly
algorithm
:
KeyAlgorithm
readonly
extractable
:
boolean
readonly
type
:
KeyType
readonly
usages
:
KeyUsage
[]