exercises/java/multi-cmk-start/src/main/java/sfw/example/esdkworkshop/App.java [28:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  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;
    // MULTI-CMK-START: Configure Walter

    // Set up the Master Key Provider to use KMS
    // MULTI-CMK-START: Add Walter to the CMKs to Use
    KmsMasterKeyProvider mkp = KmsMasterKeyProvider.builder().buildStrict(faytheCMK);

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



exercises/java/add-esdk-complete/src/main/java/sfw/example/esdkworkshop/App.java [29:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  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();

    // ADD-ESDK-COMPLETE: Configure the Faythe CMK in the Encryption SDK
    // Load configuration of KMS resources
    String faytheCMK = stateConfig.contents.state.FaytheCMK;

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

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



