From 8f300bc8a74ba236aa04536d66cfdfa448843012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 20 Dec 2018 00:11:57 +0100 Subject: [PATCH] crypto: always accept certificates as public keys PR-URL: https://github.com/nodejs/node/pull/24234 Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- doc/api/crypto.md | 2 ++ src/node_crypto.cc | 31 ++++++++++++------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 017eb91e678..fc1e2ae70ca 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1831,6 +1831,8 @@ Creates and returns a new key object containing a public key. If `key` is a string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. +If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + ### crypto.createSecretKey(key)