diff options
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java')
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java | 50 |
1 files changed, 0 insertions, 50 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 deleted file mode 100644 index a6be0af63..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.security.MessageDigest; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * Builder for the BPK, as defined in - * <code>"Ableitung f¨r die bereichsspezifische Personenkennzeichnung"</code> - * version <code>1.0.1</code> from <code>"reference.e-government.gv.at"</code>. - * - * @author Paul Schamberger - * @version $Id$ - */ -public class BPKBuilder { - - /** - * Builds the BPK from 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 - */ - 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; - 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); - } - } - -} |