diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-09-04 09:37:31 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-09-04 09:37:31 +0200 |
commit | eadd6dd97f1b30608b31ffcd90382874fbcdaddc (patch) | |
tree | 1e02de018bcb417bf897f06fb79bf64eda9b4b06 /common/src/main/java | |
parent | 61362f940ca679fe215de34b1683e1110fea8d3e (diff) | |
parent | 69f2dfdf3e0b5d976df3cdece6a8ead4848d746a (diff) | |
download | moa-id-spss-eadd6dd97f1b30608b31ffcd90382874fbcdaddc.tar.gz moa-id-spss-eadd6dd97f1b30608b31ffcd90382874fbcdaddc.tar.bz2 moa-id-spss-eadd6dd97f1b30608b31ffcd90382874fbcdaddc.zip |
Merge SPSS
Diffstat (limited to 'common/src/main/java')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/Constants.java | 21 | ||||
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java | 33 |
2 files changed, 52 insertions, 2 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java index 39cee3a04..3b6e8c57d 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java @@ -83,7 +83,7 @@ public interface Constants { /** Local location of the MOA XML schema definition. */ public static final String MOA_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOA-SPSS-1.4.7.xsd"; + SCHEMA_ROOT + "MOA-SPSS-1.5.2.xsd"; /** URI of the MOA configuration XML namespace. */ public static final String MOA_CONFIG_NS_URI = @@ -399,7 +399,19 @@ public interface Constants { /** URI of the SHA1 digest algorithm */ public static final String SHA1_URI = "http://www.w3.org/2000/09/xmldsig#sha1"; - + + /** URI of the SHA1 digest algorithm */ + public static final String SHA256_URI = + "http://www.w3.org/2000/09/xmldsig#sha256"; + + /** URI of the SHA1 digest algorithm */ + public static final String SHA384_URI = + "http://www.w3.org/2000/09/xmldsig#sha384"; + + /** URI of the SHA1 digest algorithm */ + public static final String SHA512_URI = + "http://www.w3.org/2000/09/xmldsig#sha512"; + /** URI of the Canonical XML algorithm */ public static final String C14N_URI = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"; @@ -426,6 +438,11 @@ public interface Constants { public static final String MOA_SPSS_CREATE_XML_REQUEST = "CreateXMLSignatureRequest"; /** + * Local name of request for creating a CMS signature. + */ + public static final String MOA_SPSS_CREATE_CMS_REQUEST = "CreateCMSSignatureRequest"; + + /** * Local name of request for verifying an XML signature. */ public static final String MOA_SPSS_VERIFY_XML_REQUEST = "VerifiyXMLSignatureRequest"; diff --git a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java index 7effe8b4f..cac179a75 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java @@ -27,8 +27,10 @@ package at.gv.egovernment.moa.util; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.URL; /** @@ -136,5 +138,36 @@ public class FileUtils { return newURL; } } + + + private static void copy( InputStream fis, OutputStream fos ) + { + try + { + byte[] buffer = new byte[ 0xFFFF ]; + for ( int len; (len = fis.read(buffer)) != -1; ) + fos.write( buffer, 0, len ); + } + catch( IOException e ) { + System.err.println( e ); + } + finally { + if ( fis != null ) + try { fis.close(); } catch ( IOException e ) { e.printStackTrace(); } + if ( fos != null ) + try { fos.close(); } catch ( IOException e ) { e.printStackTrace(); } + } + } + + public static void copyFile(File src, File dest) + { + try + { + copy( new FileInputStream( src ), new FileOutputStream( dest ) ); + } + catch( IOException e ) { + e.printStackTrace(); + } + } } |