Skip to content

Instantly share code, notes, and snippets.

@obfusk
Created June 28, 2024 18:51
Show Gist options
  • Save obfusk/572b537684345a1bb39f9ee88408a2db to your computer and use it in GitHub Desktop.
Save obfusk/572b537684345a1bb39f9ee88408a2db to your computer and use it in GitHub Desktop.
import java.security.cert.CertificateFactory
import java.security.cert.X509Certificate
def i = new FileInputStream(args[0])
def cert = CertificateFactory.getInstance("X.509").generateCertificate(i)
println cert.getIssuerX500Principal().getName(javax.security.auth.x500.X500Principal.CANONICAL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment