public class Association extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
FAILED_ASSOC_HANDLE |
static String |
HMAC_SHA1_ALGORITHM |
static int |
HMAC_SHA1_KEYSIZE |
static String |
HMAC_SHA256_ALGORITHM |
static int |
HMAC_SHA256_KEYSIZE |
static String |
TYPE_HMAC_SHA1 |
static String |
TYPE_HMAC_SHA256 |
Modifier and Type | Method and Description |
---|---|
static Association |
createHmacSha1(String handle,
byte[] macKeyBytes,
Date expDate) |
static Association |
createHmacSha1(String handle,
byte[] macKeyBytes,
int expiryIn) |
static Association |
createHmacSha256(String handle,
byte[] macKeyBytes,
Date expDate) |
static Association |
createHmacSha256(String handle,
byte[] macKeyBytes,
int expiryIn) |
protected static SecretKey |
createMacKey(String algorithm,
byte[] macKey) |
static Association |
generate(String type,
String handle,
int expiryIn) |
static Association |
generateHmacSha1(String handle,
int expiryIn) |
static Association |
generateHmacSha256(String handle,
int expiryIn) |
protected static SecretKey |
generateMacKey(String algorithm,
int keySize) |
protected static SecretKey |
generateMacSha1Key() |
protected static SecretKey |
generateMacSha256Key() |
Date |
getExpiry() |
static Association |
getFailedAssociation(Date expiry) |
static Association |
getFailedAssociation(int expiryIn) |
String |
getHandle() |
SecretKey |
getMacKey() |
String |
getType() |
boolean |
hasExpired() |
static boolean |
isHmacSha1Supported() |
static boolean |
isHmacSha256Supported() |
static boolean |
isHmacSupported(String hMacType) |
protected byte[] |
sign(byte[] data) |
String |
sign(String text) |
boolean |
verifySignature(String text,
String signature) |
public static final String FAILED_ASSOC_HANDLE
public static final String TYPE_HMAC_SHA1
public static final String TYPE_HMAC_SHA256
public static final String HMAC_SHA1_ALGORITHM
public static final String HMAC_SHA256_ALGORITHM
public static final int HMAC_SHA1_KEYSIZE
public static final int HMAC_SHA256_KEYSIZE
public static Association getFailedAssociation(Date expiry)
public static Association getFailedAssociation(int expiryIn)
public static Association generate(String type, String handle, int expiryIn) throws AssociationException
AssociationException
public static Association generateHmacSha1(String handle, int expiryIn)
public static Association createHmacSha1(String handle, byte[] macKeyBytes, int expiryIn)
public static Association createHmacSha1(String handle, byte[] macKeyBytes, Date expDate)
public static Association generateHmacSha256(String handle, int expiryIn)
public static Association createHmacSha256(String handle, byte[] macKeyBytes, int expiryIn)
public static Association createHmacSha256(String handle, byte[] macKeyBytes, Date expDate)
protected static SecretKey generateMacSha1Key()
protected static SecretKey generateMacSha256Key()
public static boolean isHmacSupported(String hMacType)
public static boolean isHmacSha256Supported()
public static boolean isHmacSha1Supported()
public String getType()
public String getHandle()
public SecretKey getMacKey()
public Date getExpiry()
public boolean hasExpired()
protected byte[] sign(byte[] data) throws AssociationException
AssociationException
public String sign(String text) throws AssociationException
AssociationException
public boolean verifySignature(String text, String signature) throws AssociationException
AssociationException
Copyright © 2017 Sxip. All rights reserved.