exercises/java/encryption-context-start/src/main/java/sfw/example/esdkworkshop/App.java [28:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static Api initializeDocumentBucket() {
    // Load the TOML State file with the information about launched CloudFormation resources
    StateConfig stateConfig = new StateConfig(Config.contents.base.state_file);

    // Configure DynamoDB client
    String tableName = stateConfig.contents.state.DocumentTable;
    AmazonDynamoDB ddbClient = AmazonDynamoDBClientBuilder.defaultClient();

    // Configure S3 client
    String bucketName = stateConfig.contents.state.DocumentBucket;
    AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();

    // Load configuration of KMS resources
    String faytheCMK = stateConfig.contents.state.FaytheCMK;
    String walterCMK = stateConfig.contents.state.WalterCMK;

    // Set up the Master Key Provider to use KMS
    KmsMasterKeyProvider mkp = KmsMasterKeyProvider.builder().buildStrict(faytheCMK, walterCMK);

    return new Api(ddbClient, tableName, s3Client, bucketName, mkp);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



exercises/java/encryption-context-complete/src/main/java/sfw/example/esdkworkshop/App.java [28:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static Api initializeDocumentBucket() {
    // Load the TOML State file with the information about launched CloudFormation resources
    StateConfig stateConfig = new StateConfig(Config.contents.base.state_file);

    // Configure DynamoDB client
    String tableName = stateConfig.contents.state.DocumentTable;
    AmazonDynamoDB ddbClient = AmazonDynamoDBClientBuilder.defaultClient();

    // Configure S3 client
    String bucketName = stateConfig.contents.state.DocumentBucket;
    AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();

    // Load configuration of KMS resources
    String faytheCMK = stateConfig.contents.state.FaytheCMK;
    String walterCMK = stateConfig.contents.state.WalterCMK;

    // Set up the Master Key Provider to use KMS
    KmsMasterKeyProvider mkp = KmsMasterKeyProvider.builder().buildStrict(faytheCMK, walterCMK);

    return new Api(ddbClient, tableName, s3Client, bucketName, mkp);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



exercises/java/multi-cmk-complete/src/main/java/sfw/example/esdkworkshop/App.java [28:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static Api initializeDocumentBucket() {
    // Load the TOML State file with the information about launched CloudFormation resources
    StateConfig stateConfig = new StateConfig(Config.contents.base.state_file);

    // Configure DynamoDB client
    String tableName = stateConfig.contents.state.DocumentTable;
    AmazonDynamoDB ddbClient = AmazonDynamoDBClientBuilder.defaultClient();

    // Configure S3 client
    String bucketName = stateConfig.contents.state.DocumentBucket;
    AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();

    // Load configuration of KMS resources
    String faytheCMK = stateConfig.contents.state.FaytheCMK;
    String walterCMK = stateConfig.contents.state.WalterCMK;

    // Set up the Master Key Provider to use KMS
    KmsMasterKeyProvider mkp = KmsMasterKeyProvider.builder().buildStrict(faytheCMK, walterCMK);

    return new Api(ddbClient, tableName, s3Client, bucketName, mkp);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



