diff --git a/build.xml b/build.xml
index 95626d60..a2c402bd 100644
--- a/build.xml
+++ b/build.xml
@@ -470,6 +470,25 @@
+
+
+ Removing old Eduserv gateway certificate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/remove_old_eduserv_cert.pl b/build/remove_old_eduserv_cert.pl
new file mode 100755
index 00000000..0472e61e
--- /dev/null
+++ b/build/remove_old_eduserv_cert.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+
+#
+# The input file is a fragment file that may or may not need to have
+# the old Eduserv gateway certificate removed from it. Remove the certificate if
+# required, or just re-export the file unchanged.
+#
+
+# This line indicates that the old certificate is present
+$old_cert_line = 'MIIDaTCCAtKgAwIBAgIQLqPCly3VfA8B2xVsTv59ajANBgkqhkiG9w0BAQUFADCB';
+
+while (<>) {
+
+ if (/$old_cert_line/) {
+ $delete = 1;
+ }
+
+ if ($ended) {
+ print $_;
+ } else {
+ push @lines, $_;
+ if ($delete && /<\/KeyDescriptor/) {
+ while ((pop @lines) !~ //) {
+ # re-export the old file
+ while ($line = shift @lines) {
+ print $line;
+ }
+ $ended = 1;
+ }
+
+}
+
+# end