introduce new builtin crypto.parse_private_keys

* crypto.parse_private_keys parses private keys, returns a list of valid
keys
* consolidated getPrivateKeysFromString  with getPrivateKeysFromPEMData
for crypto.x509.parse_rsa_private_key  and crypto.parse_private_keys

* reworked crypto.x509.parse_rsa_private_key so that we no longer need
getPrivateKeysFromString  but instead determine type of key in builtin
function and added input validation checks

Co-authored-by: Charlie Egan <git@charlieegan3.com>
Signed-off-by: Emil Volckmar Ry <emilvry@gmail.com>
This commit is contained in:
Emil Volckmar Ry
2023-07-08 22:53:20 +02:00
committed by Ashutosh Narkar
parent 57c4daa7fa
commit cfb03ca495
6 changed files with 498 additions and 143 deletions
+25
View File
@@ -671,6 +671,31 @@
"type": "function"
}
},
{
"name": "crypto.parse_private_keys",
"decl": {
"args": [
{
"type": "string"
}
],
"result": {
"dynamic": {
"dynamic": {
"key": {
"type": "string"
},
"value": {
"type": "any"
}
},
"type": "object"
},
"type": "array"
},
"type": "function"
}
},
{
"name": "crypto.sha1",
"decl": {