get_key ()

Get the key from the authenticated instance.

Access

public

Returns

Type

Description

string

The key from the authenticated instance.

Examples

Create a policy and get the account key.

// Instantiate S3
$s3 = new AmazonS3();

// Create a new S3 policy using an associative array
$policy = new s3Policy($s3, array(
	'Version' => '2008-10-17',
	'Statement' => array(
		array( // Statement #1
			'Sid' => 'AddPerm',
			'Effect' => 'Allow',
			'Principal' => array(
				'AWS' => '*'
			),
			'Action' => array('s3:ReadObject'),
			'Resource' => array('arn:aws:s3:::my-bucket/*')
		)
	)
));

// Success?
var_dump($policy->get_key());
Result:
string(20) "AKIAIFUPOHJBYISR6QBA"

Related Methods

Source

Method defined in utilities/policy.class.php | Toggle source view (4 lines) | View on GitHub

public function get_key()
{
    return $this->auth->key;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback