-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added operation Parse X509 Certificate Bundles #954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the .idea
directory from this PR please?
@@ -137,6 +137,7 @@ | |||
"nodom": "^2.4.0", | |||
"notepack.io": "^2.2.0", | |||
"nwmatcher": "^1.4.4", | |||
"openssl-nodejs": "^1.0.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is imported but never used.
run(input, args) { | ||
|
||
if (!input.length) { | ||
return "No input"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use throw new OperationError(msg)
instead of simply returning a string. This has repercussions for the NodeAPI.
} | ||
|
||
while ((m = regex2.exec(input)) !== null) { | ||
// This is necessary to avoid infinite loops with zero-width matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These regexes can't hit on zero-width matches, so this check is unnecessary.
let count = 0; | ||
|
||
while ((m = regex1.exec(input)) !== null) { | ||
// This is necessary to avoid infinite loops with zero-width matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These regexes can't hit on zero-width matches, so this check is unnecessary.
|
||
// Extensions | ||
try { | ||
// extensions =cert.getInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line
} | ||
|
||
count++; | ||
res += "\nCertificate:\n" + parseCert("-----BEGIN CERTIFICATE-----" + "\n" + m[1] + "\n" + "-----END CERTIFICATE-----"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use template strings to tidy this up a little. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
Neha Gopinath seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This was reviewed and never updated over four years ago, so I'm going to close this PR for now! |
The operation ParseX.509Certificate parses a single X.509 certificate and displays the parsed certificate information. The newly added operation ParseX.509CertificateBundles, parses X.509 certificate bundles and displays the information (Validity, Issuer, Subject, Extensions) of each parsed certificate one after another.
This operation helps parsing certificate bundles also as a PEM file.