From e4ef1a719fafe32162274f3eaf2a47fb50509671 Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 29 Nov 2010 14:32:54 +0000 Subject: strict checking vor signparam versions git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@643 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/sig/sigkz/SigKZIDHelper.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigkz/SigKZIDHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigkz/SigKZIDHelper.java index 9a144db..4c83d76 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigkz/SigKZIDHelper.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigkz/SigKZIDHelper.java @@ -73,7 +73,7 @@ public final class SigKZIDHelper String prefix = (ids[0].split(":"))[0]; - if (prefix.startsWith(DetachedLocRefMOAIdFormatter.SIG_ID_PREFIX)) + if (prefix.equals(DetachedLocRefMOAIdFormatter.SIG_ID_PREFIX)) { return true; } @@ -116,7 +116,7 @@ public final class SigKZIDHelper if (algorithmId == null) { return false; } else { - return algorithmId.startsWith("etsi-moc-"); + return algorithmId.startsWith("etsi-moc-1.0") || algorithmId.startsWith("etsi-moc-1.1"); } } @@ -221,7 +221,22 @@ public final class SigKZIDHelper if (sig_id == null && StringUtils.isEmpty(sig_id)) { return false; } - return sig_id.startsWith("etsi-bka-atrust"); + return sig_id.startsWith("etsi-bka-atrust-1.0"); + } + + /** + * Checks if signed with a known BKU method/param + * @param so + * @return + */ + public static boolean isBKUSigned(SignSignatureObject so) throws ConnectorException { + if (isOldBKU(so)) return true; + + if (so.id.startsWith("etsi-bka-1.0")) { + return true; + } + + return false; } } -- cgit v1.2.3