Last active
April 8, 2021 09:13
-
-
Save kouzouigh/b2455dd1951a7cfedc3a5cae57107e8e to your computer and use it in GitHub Desktop.
Generate CSR with with openssl executed with groovy script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..150).each { | |
def command = ["openssl", "req", "-nodes", "-newkey", "rsa:2048", "-keyout", "/tmp/csr/example${it}.key", "-out", "/tmp/csr/csr_example_${it}.csr", "-subj", "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=example${it}.com"] | |
def sout = new StringBuilder(), serr = new StringBuilder() | |
def proc = command.execute() | |
proc.consumeProcessOutput(sout, serr) | |
proc.waitFor() | |
println "out> $sout\nerr> $serr" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment