Hi Aneela,

All methods from DFS CLI are exposed in KMS HTTP REST API. Your java
application can then make http requests to KMS. Here is an example of
related http request format for creating a key:

POST http://HOST:PORT/kms/v1/keys
Content-Type: application/json

{
  "name"        : "<key-name>",
  "cipher"      : "<cipher>",
  "length"      : <length>,        //int
  "material"    : "<material>",    //base64
  "description" : "<description>"
}




This and all exposed methods are detailed on " KMS HTTP REST API" section
form KMS online documentation here:
http://hadoop.apache.org/docs/r2.7.2/hadoop-kms/index.html

Regards,
Wellington.

2016-12-14 13:39 GMT+00:00 Aneela Saleem <[email protected]>:

> Hi,
>
> I have successfully enables Hadoop with KMS and now I want to write some
> java code to create key, get keys and encrypt a directory using a key. In
> other words, I want to translate this command
>
> hdfs hdfs crypto -createZone -keyName <key_name> -path /encryption_zone
>
> and
>
> hdfs hdfs crypto -listZones
>
>
> into java code.
>
>
> Any suggestions will be appreciated.
>
> Thanks
>

Reply via email to