• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Java SDK)
  4. Initialization
  5. Transparently Transferring the AK/SK

Transparently Transferring the AK/SK

OBS Java SDK provides SecretFlexibleObsClient that support transparent transfer of AKs and SKs in API functions. Sample code is as follows:

String endPoint = "yourdomainname";
// Create an ObsConfiguration instance.
ObsConfiguration config = new ObsConfiguration();
config.setEndPoint(endPoint);
config.setHttpsOnly(true);

// Create a SecretFlexibleObsClient instance.
SecretFlexibleObsClient obsClient = new SecretFlexibleObsClient(config);
// Use the instance to access OBS.
String ak1 = "*** Provide your Access Key 1 ***";
String sk1 = "*** Provide your Secret Key 1 ***";
obsClient.listBuckets(ak1, sk1);

String ak2 = "*** Provide your Access Key 2 ***";
String sk2 = "*** Provide your Secret Key 2 ***";
obsClient.listBuckets(ak2, sk2);

// Close obsClient.
obsClient.close();
NOTE:

SecretFlexibleObsClient is inherited from ObsClient and can be used as ObsClient.