#!/bin/bash

printf "CHECKING EXPIRATIONS\n\n"

for f in *.crt
do
	COMMON_NAME=`openssl x509 -noout -subject -in "$f"`
	EXPIRES=`openssl x509 -enddate -noout -in "$f"`
	printf "%s\n%s\n\n" "$COMMON_NAME" "$EXPIRES"
done