aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-03-14 12:19:07 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-03-14 12:19:07 +0100
commita5c361d60ab4103026cdaac1818ecec52611be5d (patch)
tree51d120382d5db3a5ac7ef0ef3d69567a17ba5441 /id
parent0000acfdc7ca31b9ba2d2956c0ce36c4146c3033 (diff)
downloadmoa-id-spss-a5c361d60ab4103026cdaac1818ecec52611be5d.tar.gz
moa-id-spss-a5c361d60ab4103026cdaac1818ecec52611be5d.tar.bz2
moa-id-spss-a5c361d60ab4103026cdaac1818ecec52611be5d.zip
change Base64 decoder implementation
Diffstat (limited to 'id')
-rw-r--r--id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java b/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
index 28ce69e95..31c91cd40 100644
--- a/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
+++ b/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
@@ -46,9 +46,8 @@
package at.gv.egovernment.moa.id.auth.parser;
-import iaik.x509.X509Certificate;
-
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.security.cert.CertificateException;
@@ -57,7 +56,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
-import org.apache.axis.encoding.Base64;
import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -66,9 +64,11 @@ import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
import at.gv.egovernment.moa.id.auth.exception.BKUException;
import at.gv.egovernment.moa.id.auth.exception.ParseException;
+import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.Constants;
import at.gv.egovernment.moa.util.DOMUtils;
import at.gv.egovernment.moa.util.XPathUtils;
+import iaik.x509.X509Certificate;
/**
* Parses an <code>&lt;InfoboxReadResponse&gt;</code>.
@@ -256,16 +256,14 @@ public class InfoboxReadResponseParser {
String base64Content = DOMUtils.getText(base64ContentElement);
- // Decode Base64 value to X509Certificate
- byte[] content = Base64.decode(base64Content);
+ // Decode Base64 value to X509Certificate
+ byte[] content = Base64Utils.decode(base64Content, false);
return new X509Certificate(content);
- } catch (ParserConfigurationException e) {
- throw new ParseException("parser.01", new Object[] { "Could not parse X509Certificate from InfoboxReadRequest."}, e);
- } catch (TransformerException e) {
- throw new ParseException("parser.01", new Object[] { "Could not parse X509Certificate from InfoboxReadRequest."}, e);
- } catch (CertificateException e) {
+ } catch (ParserConfigurationException | TransformerException |
+ CertificateException | IOException e) {
throw new ParseException("parser.01", new Object[] { "Could not parse X509Certificate from InfoboxReadRequest."}, e);
+
}
}