aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at
diff options
context:
space:
mode:
authorharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2006-03-15 15:50:09 +0000
committerharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2006-03-15 15:50:09 +0000
commit4db3ebf01ca4aee1ed5b25b467bf97f2f1b9875e (patch)
treee3354a2448d2b37cb7524f32f19eac4c1f463a32 /id.server/src/at
parent655d0a525cb37d23f4b12bcadee62ad839e614ff (diff)
downloadmoa-id-spss-4db3ebf01ca4aee1ed5b25b467bf97f2f1b9875e.tar.gz
moa-id-spss-4db3ebf01ca4aee1ed5b25b467bf97f2f1b9875e.tar.bz2
moa-id-spss-4db3ebf01ca4aee1ed5b25b467bf97f2f1b9875e.zip
Fehler bei bPK-Berechnung behoben (bis jetzt wurde das bPK
nur aus Stammzahl und Bereichskürzel berechnet, das URN-Präfix wurde nicht berücksichtigt). git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@661 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java35
1 files changed, 17 insertions, 18 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
index a6be0af63..6cc8c1be8 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
@@ -4,9 +4,10 @@ import java.security.MessageDigest;
import at.gv.egovernment.moa.id.BuildException;
import at.gv.egovernment.moa.util.Base64Utils;
+import at.gv.egovernment.moa.util.Constants;
/**
- * Builder for the BPK, as defined in
+ * Builder for the bPK, as defined in
* <code>&quot;Ableitung f&uml;r die bereichsspezifische Personenkennzeichnung&quot;</code>
* version <code>1.0.1</code> from <code>&quot;reference.e-government.gv.at&quot;</code>.
*
@@ -16,34 +17,32 @@ import at.gv.egovernment.moa.util.Base64Utils;
public class BPKBuilder {
/**
- * Builds the BPK from given parameters.
+ * Builds the bPK from the given parameters.
* @param identificationValue Base64 encoded "Stammzahl"
* @param target "Bereich lt. Verordnung des BKA"
- * @return PBK in a BASE64 encoding
- * @throws BuildException in case of error while building the BPK
+ * @return bPK in a BASE64 encoding
+ * @throws BuildException if an error occurs on building the bPK
*/
public String buildBPK(String identificationValue, String target)
throws BuildException {
- if (identificationValue == null || identificationValue.length() == 0
- || target == null || target.length() == 0)
- throw new BuildException(
- "builder.00",
- new Object[] {"BPK",
- "Unvollständige Parameterangaben: identificationValue=" + identificationValue +
- ",target=" + target});
- String basisbegriff = identificationValue + "+" + target;
+ if ((identificationValue == null ||
+ identificationValue.length() == 0 ||
+ target == null ||
+ target.length() == 0))
+ {
+ throw new BuildException("builder.00",
+ new Object[] {"BPK", "Unvollständige Parameterangaben: identificationValue=" +
+ identificationValue + ",target=" + target});
+ }
+ String basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_CDID + "+" + target;
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
String hashBase64 = Base64Utils.encode(hash);
return hashBase64;
- }
- catch (Exception ex) {
- throw new BuildException(
- "builder.00",
- new Object[] {"BPK", ex.toString()},
- ex);
+ } catch (Exception ex) {
+ throw new BuildException("builder.00", new Object[] {"BPK", ex.toString()}, ex);
}
}