object-transform

EMC library for encoding/decoding object content (i.e. encrypting and/or compressing) - implements the EMC client encryption standard (https://community.emc.com/docs/DOC-34465)

License

License

Categories

Categories

ORM Data
GroupId

GroupId

com.emc.ecs
ArtifactId

ArtifactId

object-transform
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

object-transform
EMC library for encoding/decoding object content (i.e. encrypting and/or compressing) - implements the EMC client encryption standard (https://community.emc.com/docs/DOC-34465)
Project URL

Project URL

https://community.emc.com/community/products/vipr#developer
Source Code Management

Source Code Management

https://github.com/emcvipr/ecs-object-transform-java

Download object-transform

How to add to project

<!-- https://jarcasting.com/artifacts/com.emc.ecs/object-transform/ -->
<dependency>
    <groupId>com.emc.ecs</groupId>
    <artifactId>object-transform</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.emc.ecs/object-transform/
implementation 'com.emc.ecs:object-transform:1.1.0'
// https://jarcasting.com/artifacts/com.emc.ecs/object-transform/
implementation ("com.emc.ecs:object-transform:1.1.0")
'com.emc.ecs:object-transform:jar:1.1.0'
<dependency org="com.emc.ecs" name="object-transform" rev="1.1.0">
  <artifact name="object-transform" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.emc.ecs', module='object-transform', version='1.1.0')
)
libraryDependencies += "com.emc.ecs" % "object-transform" % "1.1.0"
[com.emc.ecs/object-transform "1.1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
commons-codec : commons-codec jar 1.10
org.b1.pack : lzma-sdk-4j jar 9.22.0
org.slf4j : slf4j-api jar 1.7.5

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.5

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

EMC library for encoding/decoding object content (i.e. encrypting and/or compressing)

implements the EMC client encryption standard (https://community.emc.com/docs/DOC-34465)

Basic Usage

Encryption:

    // you manage your own keys; you can optionally implement your own KeyProvider based on any key management suite.
    // this example uses a keystore file named my_keystore.jks
    KeyStore keystore = KeyStore.getInstance("jks");
    keystore.load(new FileInputStream("my_keystore.jks"), "my_keystore_password".toCharArray());
    KeyProvider keyProvider = new KeystoreKeyProvider(getKeystore(), "viprviprvipr".toCharArray(), "masterkey");

    // simply create the chain using default parameters
    CodecChain chain = new CodecChain(new EncryptionCodec()).withProperty(EncryptionCodec.PROP_KEY_PROVIDER, keyProvider);
    
    // now encode your object. you must provide a map of metadata (it can be empty), which will contain all of the
    // encoding information necessary to decode the object. this metadata should be stored along with your object.
    // this example uses S3 (via the AWS SDK)
    Map<String, String> metadata = new HashMap<String, String>();
    s3client.putObject(myBucket, myKey, chain.getEncodeStream(myRawObjectStream, metadata), null);
    
    // some encode metadata is not available until after the object is streamed. be *sure* to update the object with
    // the complete set of encode metadata or you may not be able to decode it!
    CopyObjectRequest request = new CopyObjectRequest(myBucket, myKey, myBucket, myKey);
    ObjectMetadata objectMetadata = new ObjectMetadata();
    objectMetadata.setUserMetadata(metadata);
    request.setNewObjectMetadata(objectMetadata);
    s3client.copyObject(request);

Compression:

    // simply create the chain using default parameters
    CodecChain chain = new CodecChain(new DeflateCodec());
    
    // now encode your object. you must provide a map of metadata (it can be empty), which will contain all of the
    // encoding information necessary to decode the object. this metadata should be stored along with your object.
    // this example uses S3 (via the AWS SDK)
    Map<String, String> metadata = new HashMap<String, String>();
    s3client.putObject(myBucket, myKey, chain.getEncodeStream(myRawObjectStream, metadata), null);
    
    // some encode metadata is not available until after the object is streamed. be *sure* to update the object with
    // the complete set of encode metadata or you may not be able to decode it!
    CopyObjectRequest request = new CopyObjectRequest(myBucket, myKey, myBucket, myKey);
    ObjectMetadata objectMetadata = new ObjectMetadata();
    objectMetadata.setUserMetadata(metadata);
    request.setNewObjectMetadata(objectMetadata);
    s3client.copyObject(request);

Compression and encryption:

    // you manage your own keys; you can optionally implement your own KeyProvider based on any key management suite.
    // this example uses a keystore file named my_keystore.jks
    KeyStore keystore = KeyStore.getInstance("jks");
    keystore.load(new FileInputStream("my_keystore.jks"), "my_keystore_password".toCharArray());
    KeyProvider keyProvider = new KeystoreKeyProvider(getKeystore(), "viprviprvipr".toCharArray(), "masterkey");

    // simply create the chain using default parameters
    CodecChain chain = new CodecChain(new DeflateCodec(), new EncryptionCodec())
            .withProperty(EncryptionCodec.PROP_KEY_PROVIDER, keyProvider);
    
    // now encode your object. you must provide a map of metadata (it can be empty), which will contain all of the
    // encoding information necessary to decode the object. this metadata should be stored along with your object.
    // this example uses S3 (via the AWS SDK)
    Map<String, String> metadata = new HashMap<String, String>();
    s3client.putObject(myBucket, myKey, chain.getEncodeStream(myRawObjectStream, metadata), null);
    
    // some encode metadata is not available until after the object is streamed. be *sure* to update the object with
    // the complete set of encode metadata or you may not be able to decode it!
    CopyObjectRequest request = new CopyObjectRequest(myBucket, myKey, myBucket, myKey);
    ObjectMetadata objectMetadata = new ObjectMetadata();
    objectMetadata.setUserMetadata(metadata);
    request.setNewObjectMetadata(objectMetadata);
    s3client.copyObject(request);

Note: when adding multiple plugins to a chain, they will be ordered based on pre-determined priority (compression before encryption) and you may not apply more than one plugin of the same type (compression or encryption) to the same object (this would overwrite some encode metadata and make the object unreadable).

com.emc.ecs

Versions

Version
1.1.0
1.0.2
1.0.1
1.0.0