diff options
author | Klaus Stranacher <kstranacher@iaik.tugraz.at> | 2013-08-14 16:36:40 +0200 |
---|---|---|
committer | Klaus Stranacher <kstranacher@iaik.tugraz.at> | 2013-08-14 16:36:40 +0200 |
commit | a52d3300d20837b12b45a0d4fb2b0ee520f6e641 (patch) | |
tree | f2f3259231718a3871ca27b8ee61c857377378ac /common/src/main/java | |
parent | 8591e43ef7f8e1eb0be50a0726d507904b26b9f5 (diff) | |
download | moa-id-spss-a52d3300d20837b12b45a0d4fb2b0ee520f6e641.tar.gz moa-id-spss-a52d3300d20837b12b45a0d4fb2b0ee520f6e641.tar.bz2 moa-id-spss-a52d3300d20837b12b45a0d4fb2b0ee520f6e641.zip |
TSL integration updates:
- Setting of hashcache parameter in MOA
- Update MOA-SP Response (Source attribute in QualifiedCertificate and SecureSignatureCreationDevice element)
- Hidden truststores (for TSL enabled truststore: given certificates are copied to hidden truststore, where TSL certificates are copied)
- Update of QC and SSCD detection
- Update MOA-SPSS config: EU TSL URL can be set via configuration
Diffstat (limited to 'common/src/main/java')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java | 33 |
1 files changed, 33 insertions, 0 deletions
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(); + } + } } |