#!/usr/bin/perl -w

# Verify X509 Common Name

# Return 0 if cn matches the common name component of X509_NAME_oneline,
# 1 otherwise.

($depth, $cn) = @ARGV;

# debugging purposes
# print "<$cn> <$depth>\n";

## HIER MUSS ZUM VERIFIZIEREN DER PASSENDE STRING HIN

## CA
if ($depth   == 1
&& $cn eq '/C=DE/ST=Bayern/L=Erlangen/O=Friedrich-Alexander.Universitaet/OU=Informatik.CIP-Pool.CA/CN=CA.Informatik/Email=ca@cip.informatik.uni-erlangen.de') {
	exit 0;
} 
## DER VON _NAME_
elsif  ($depth == 0
&& $cn eq '/C=DE/ST=Rheinland-Pfalz/L=Boppard/O=blackwing.de/OU=Home.DialUp.Service/CN=Sebastian.Werner..sisewern./Email=sisewern@stud.informatik.uni-erlangen.de') {
	exit 0;
}

exit 1;
