org.openid4java.association
Class Association
java.lang.Object
org.openid4java.association.Association
- All Implemented Interfaces:
- java.io.Serializable
public class Association
- extends java.lang.Object
- implements java.io.Serializable
- Author:
- Marius Scurtescu, Johnny Bufu
- See Also:
- Serialized Form
Method Summary |
static Association |
createHmacSha1(java.lang.String handle,
byte[] macKeyBytes,
java.util.Date expDate)
|
static Association |
createHmacSha1(java.lang.String handle,
byte[] macKeyBytes,
int expiryIn)
|
static Association |
createHmacSha256(java.lang.String handle,
byte[] macKeyBytes,
java.util.Date expDate)
|
static Association |
createHmacSha256(java.lang.String handle,
byte[] macKeyBytes,
int expiryIn)
|
protected static javax.crypto.SecretKey |
createMacKey(java.lang.String algorithm,
byte[] macKey)
|
static Association |
generate(java.lang.String type,
java.lang.String handle,
int expiryIn)
|
static Association |
generateHmacSha1(java.lang.String handle,
int expiryIn)
|
static Association |
generateHmacSha256(java.lang.String handle,
int expiryIn)
|
protected static javax.crypto.SecretKey |
generateMacKey(java.lang.String algorithm,
int keySize)
|
protected static javax.crypto.SecretKey |
generateMacSha1Key()
|
protected static javax.crypto.SecretKey |
generateMacSha256Key()
|
java.util.Date |
getExpiry()
|
static Association |
getFailedAssociation(java.util.Date expiry)
|
static Association |
getFailedAssociation(int expiryIn)
|
java.lang.String |
getHandle()
|
javax.crypto.SecretKey |
getMacKey()
|
java.lang.String |
getType()
|
boolean |
hasExpired()
|
static boolean |
isHmacSha1Supported()
|
static boolean |
isHmacSha256Supported()
|
static boolean |
isHmacSupported(java.lang.String hMacType)
|
protected byte[] |
sign(byte[] data)
|
java.lang.String |
sign(java.lang.String text)
|
boolean |
verifySignature(java.lang.String text,
java.lang.String signature)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FAILED_ASSOC_HANDLE
public static final java.lang.String FAILED_ASSOC_HANDLE
- See Also:
- Constant Field Values
TYPE_HMAC_SHA1
public static final java.lang.String TYPE_HMAC_SHA1
- See Also:
- Constant Field Values
TYPE_HMAC_SHA256
public static final java.lang.String TYPE_HMAC_SHA256
- See Also:
- Constant Field Values
HMAC_SHA1_ALGORITHM
public static final java.lang.String HMAC_SHA1_ALGORITHM
- See Also:
- Constant Field Values
HMAC_SHA256_ALGORITHM
public static final java.lang.String HMAC_SHA256_ALGORITHM
- See Also:
- Constant Field Values
HMAC_SHA1_KEYSIZE
public static final int HMAC_SHA1_KEYSIZE
- See Also:
- Constant Field Values
HMAC_SHA256_KEYSIZE
public static final int HMAC_SHA256_KEYSIZE
- See Also:
- Constant Field Values
getFailedAssociation
public static Association getFailedAssociation(java.util.Date expiry)
getFailedAssociation
public static Association getFailedAssociation(int expiryIn)
generate
public static Association generate(java.lang.String type,
java.lang.String handle,
int expiryIn)
throws AssociationException
- Throws:
AssociationException
generateHmacSha1
public static Association generateHmacSha1(java.lang.String handle,
int expiryIn)
createHmacSha1
public static Association createHmacSha1(java.lang.String handle,
byte[] macKeyBytes,
int expiryIn)
createHmacSha1
public static Association createHmacSha1(java.lang.String handle,
byte[] macKeyBytes,
java.util.Date expDate)
generateHmacSha256
public static Association generateHmacSha256(java.lang.String handle,
int expiryIn)
createHmacSha256
public static Association createHmacSha256(java.lang.String handle,
byte[] macKeyBytes,
int expiryIn)
createHmacSha256
public static Association createHmacSha256(java.lang.String handle,
byte[] macKeyBytes,
java.util.Date expDate)
generateMacKey
protected static javax.crypto.SecretKey generateMacKey(java.lang.String algorithm,
int keySize)
generateMacSha1Key
protected static javax.crypto.SecretKey generateMacSha1Key()
generateMacSha256Key
protected static javax.crypto.SecretKey generateMacSha256Key()
isHmacSupported
public static boolean isHmacSupported(java.lang.String hMacType)
isHmacSha256Supported
public static boolean isHmacSha256Supported()
isHmacSha1Supported
public static boolean isHmacSha1Supported()
createMacKey
protected static javax.crypto.SecretKey createMacKey(java.lang.String algorithm,
byte[] macKey)
getType
public java.lang.String getType()
getHandle
public java.lang.String getHandle()
getMacKey
public javax.crypto.SecretKey getMacKey()
getExpiry
public java.util.Date getExpiry()
hasExpired
public boolean hasExpired()
sign
protected byte[] sign(byte[] data)
throws AssociationException
- Throws:
AssociationException
sign
public java.lang.String sign(java.lang.String text)
throws AssociationException
- Throws:
AssociationException
verifySignature
public boolean verifySignature(java.lang.String text,
java.lang.String signature)
throws AssociationException
- Throws:
AssociationException
Copyright © 2011 Sxip. All Rights Reserved.