Search in sources :

Example 11 with CipherSpec

use of org.syncany.crypto.CipherSpec in project syncany by syncany.

the class DefaultRepoTOFactory method getCipherTransformerTO.

protected TransformerTO getCipherTransformerTO(List<CipherSpec> cipherSpec) {
    String cipherSuitesIdStr = StringUtil.join(cipherSpec, ",", new StringJoinListener<CipherSpec>() {

        @Override
        public String getString(CipherSpec cipherSpec) {
            return "" + cipherSpec.getId();
        }
    });
    Map<String, String> cipherTransformerSettings = new HashMap<String, String>();
    cipherTransformerSettings.put(CipherTransformer.PROPERTY_CIPHER_SPECS, cipherSuitesIdStr);
    // Note: Property 'password' is added dynamically by CommandLineClient
    TransformerTO cipherTransformerTO = new TransformerTO();
    cipherTransformerTO.setType(CipherTransformer.TYPE);
    cipherTransformerTO.setSettings(cipherTransformerSettings);
    return cipherTransformerTO;
}
Also used : HashMap(java.util.HashMap) TransformerTO(org.syncany.config.to.RepoTO.TransformerTO) CipherSpec(org.syncany.crypto.CipherSpec)

Aggregations

CipherSpec (org.syncany.crypto.CipherSpec)11 Test (org.junit.Test)5 SaltedSecretKey (org.syncany.crypto.SaltedSecretKey)3 ArrayList (java.util.ArrayList)2 CipherSession (org.syncany.crypto.CipherSession)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 OptionParser (joptsimple.OptionParser)1 OptionSet (joptsimple.OptionSet)1 Chunker (org.syncany.chunk.Chunker)1 CipherTransformer (org.syncany.chunk.CipherTransformer)1 GzipTransformer (org.syncany.chunk.GzipTransformer)1 MultiChunker (org.syncany.chunk.MultiChunker)1 NoTransformer (org.syncany.chunk.NoTransformer)1 Transformer (org.syncany.chunk.Transformer)1 TttdChunker (org.syncany.chunk.TttdChunker)1 ZipMultiChunker (org.syncany.chunk.ZipMultiChunker)1 ConfigTO (org.syncany.config.to.ConfigTO)1