public class SignerUtils extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
SignerUtils.Protocol |
Enumeration of protocols for presigned URLs
|
Constructor | Description |
---|---|
SignerUtils() |
Modifier and Type | Method | Description |
---|---|---|
static String |
buildCannedPolicy(String resourceUrlOrPath,
Date dateLessThan) |
Returns a "canned" policy for the given parameters.
|
static String |
buildCustomPolicy(String resourcePath,
Date expiresOn,
Date activeFrom,
String ipAddress) |
Returns a custom policy for the given parameters.
|
static String |
generateResourcePath(SignerUtils.Protocol protocol,
String distributionDomain,
String resourcePath) |
Returns the resource path for the given distribution, object, and
protocol.
|
static PrivateKey |
loadPrivateKey(File privateKeyFile) |
Creates a private key from the file given, either in RSA private key
(.pem) or pkcs8 (.der) format.
|
static String |
makeBytesUrlSafe(byte[] bytes) |
Converts the given data to be safe for use in signed URLs for a private
distribution by using specialized Base64 encoding.
|
static String |
makeStringUrlSafe(String str) |
Converts the given string to be safe for use in signed URLs for a private
distribution.
|
static byte[] |
signWithSha1Rsa(byte[] dataToSign,
PrivateKey privateKey) |
Signs the data given with the private key given, using the SHA1withRSA
algorithm provided by bouncy castle.
|
public static String buildCannedPolicy(String resourceUrlOrPath, Date dateLessThan)
public static String buildCustomPolicy(String resourcePath, Date expiresOn, Date activeFrom, String ipAddress)
public static String makeBytesUrlSafe(byte[] bytes)
public static String makeStringUrlSafe(String str)
public static String generateResourcePath(SignerUtils.Protocol protocol, String distributionDomain, String resourcePath)
public static byte[] signWithSha1Rsa(byte[] dataToSign, PrivateKey privateKey) throws InvalidKeyException
InvalidKeyException
public static PrivateKey loadPrivateKey(File privateKeyFile) throws InvalidKeySpecException, IOException
InvalidKeySpecException
IOException
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.