SDK for PHP 3.x

InstructionFileMetadataStrategy
in package
implements MetadataStrategyInterface

Stores and reads encryption MetadataEnvelope information in a file on Amazon S3.

A file with the contents of a MetadataEnvelope will be created or read from alongside the base file on Amazon S3. The provided client will be used for reading or writing this object. A specified suffix (default of '.instruction' will be applied to each of the operations involved with the instruction file.

If there is a failure after an instruction file has been uploaded, it will not be automatically deleted.

Table of Contents

Interfaces

MetadataStrategyInterface

Constants

DEFAULT_FILE_SUFFIX  = '.instruction'

Methods

__construct()  : mixed
load()  : MetadataEnvelope
Uses the strategy's client to retrieve the instruction file from S3 and generates a MetadataEnvelope from its contents.
save()  : array<string|int, mixed>
Places the information in the MetadataEnvelope to a location on S3.

Constants

DEFAULT_FILE_SUFFIX

public mixed DEFAULT_FILE_SUFFIX = '.instruction'

Methods

__construct()

public __construct(S3Client $client[, string|null $suffix = null ]) : mixed
Parameters
$client : S3Client

Client for use in uploading the instruction file.

$suffix : string|null = null

Optional override suffix for instruction file object keys.

load()

Uses the strategy's client to retrieve the instruction file from S3 and generates a MetadataEnvelope from its contents.

public load(array<string|int, mixed> $args) : MetadataEnvelope
Parameters
$args : array<string|int, mixed>

Arguments from Command and Result that contains S3 Object information, relevant headers, and command configuration.

Return values
MetadataEnvelope

save()

Places the information in the MetadataEnvelope to a location on S3.

public save(MetadataEnvelope $envelope, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$envelope : MetadataEnvelope

Encryption data to save according to the strategy.

$args : array<string|int, mixed>

Starting arguments for PutObject, used for saving extra the instruction file.

Return values
array<string|int, mixed>

Updated arguments for PutObject.

On this page