From 6066ff39c7f2263bd8cede8ed73a0cc61a4a305e Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 23 Jun 2006 21:41:56 +0000 Subject: [PATCH] - add ssl_email function for extracting the emailAddress from an X.509 cert --- plc.d/functions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plc.d/functions b/plc.d/functions index 92a236f..e07788c 100644 --- a/plc.d/functions +++ b/plc.d/functions @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: functions,v 1.3 2006/04/10 15:53:49 mlhuang Exp $ +# $Id: functions,v 1.4 2006/04/25 21:18:19 mlhuang Exp $ # export PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -79,6 +79,13 @@ ssl_cname () sed -n -e 's@.*/CN=\([^/]*\).*@\1@p' } +# Print the emailAddress of an SSL certificate +ssl_email () +{ + openssl x509 -noout -in $1 -subject | \ + sed -n -e 's@.*/emailAddress=\([^/]*\).*@\1@p' +} + # Forcefully make a symlink symlink () { -- 2.43.0