public class S3UploadPolicy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
HMAC_SHA1_ALGORITHM |
private java.lang.String |
policySignature |
private java.lang.String |
policyString |
Constructor and Description |
---|
S3UploadPolicy(java.lang.String awsAccessKeyId,
java.lang.String awsSecretKey,
java.lang.String bucketName,
java.lang.String prefix,
int expireInMinutes)
Creates a new S3 upload policy object from the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
base64Encode(byte[] data) |
java.lang.String |
getPolicySignature()
Policy signature in base64 format Use signature generated by this method
for passing to EC2 bunding calls along with policy.
|
java.lang.String |
getPolicyString()
Base64 representation of the serialized policy.
|
private java.lang.String |
signPolicy(java.lang.String awsSecretKey,
java.lang.String base64EncodedPolicy) |
private static final java.lang.String HMAC_SHA1_ALGORITHM
private java.lang.String policySignature
private java.lang.String policyString
public S3UploadPolicy(java.lang.String awsAccessKeyId, java.lang.String awsSecretKey, java.lang.String bucketName, java.lang.String prefix, int expireInMinutes)
awsAccessKeyId
- The AWS access key ID for the S3 bucket the bundling artifacts
should be stored in.awsSecretKey
- The AWS secret key for the specified access key.bucketName
- The name of the bucket to store the bundling artifacts in.prefix
- The prefix for the bundling artifacts.expireInMinutes
- The number of minutes before the upload policy expires and is
unable to be used.public java.lang.String getPolicyString()
public java.lang.String getPolicySignature()
private java.lang.String signPolicy(java.lang.String awsSecretKey, java.lang.String base64EncodedPolicy) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.io.UnsupportedEncodingException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.io.UnsupportedEncodingException
private java.lang.String base64Encode(byte[] data)