|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.KEACryptoToken
public abstract class KEACryptoToken
An interface for KEA cryptographic tokens to implement.
Note: This class must be extended in order to override the default implementation.
Note: It is considered good practice to implement the equals and hashCode methods when extending this class. Otherwise, odd behaviour can occur.
Details on implementing for smart cards.
Field Summary |
---|
Fields inherited from interface net.rim.device.api.crypto.AsymmetricCryptoToken |
---|
KEY_GENERATION, PRIVATE_KEY_OPERATION, PUBLIC_KEY_OPERATION |
Constructor Summary | ||
---|---|---|
|
protected |
KEACryptoToken()
Creates a new KEACryptoToken object. |
Method Summary | ||
---|---|---|
|
KEAKeyPair |
createKEAKeyPair(CryptoTokenCryptoSystemData cryptoTokenData)
Creates a key pair using the specified crypto token. |
|
void |
deleteKEAPrivateKey(CryptoTokenPrivateKeyData data)
Delete the specified key on the crypto token. |
|
void |
deleteKEAPublicKey(CryptoTokenPublicKeyData data)
Delete the specified key on the crypto token. |
|
byte[] |
extractKEAPrivateKeyData(CryptoTokenPrivateKeyData cryptoTokenData)
Returns the private key data. |
|
byte[] |
extractKEAPublicKeyData(CryptoTokenPrivateKeyData cryptoTokenData)
Returns the public key data. |
|
byte[] |
extractKEAPublicKeyData(CryptoTokenPublicKeyData cryptoTokenData)
Returns the public key data. |
|
byte[] |
generateKEASharedSecret(CryptoTokenCryptoSystemData cryptoTokenCryptoSystemData,
CryptoTokenPrivateKeyData cryptoTokenLocalStaticPrivateKeyData,
CryptoTokenPrivateKeyData cryptoTokenLocalEphemeralPrivateKeyData,
byte[] remoteStaticPublicKeyData,
byte[] remoteEphemeralPublicKeyData)
Generates the shared secret using given local and remote, public and private keys. |
|
String |
getAlgorithm()
Returns the algorithm supported by this token, ie "KEA". |
|
int |
getKEACryptoSystemBitLength(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the number of bits (aka the "strength") of the crypto system, eg 1024. |
|
CryptoTokenCryptoSystemData |
getKEACryptoSystemData(byte[] p,
byte[] q,
byte[] g,
String name)
Returns the KEA crypto system data associated with the crypto token. |
|
byte[] |
getKEACryptoSystemG(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the g domain parameter. |
|
String |
getKEACryptoSystemName(CryptoTokenCryptoSystemData cryptoTokenData)
Returns a String that indicates the set of parameters in use, eg "WTLS1", or null. |
|
byte[] |
getKEACryptoSystemP(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the p domain parameter. |
|
byte[] |
getKEACryptoSystemQ(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the q domain parameter, or null. |
|
int |
getKEAPrivateKeyLength(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the length of the private key. |
|
int |
getKEAPublicKeyLength(CryptoTokenCryptoSystemData cryptoTokenData)
Returns the length of the public key. |
|
CryptoTokenPrivateKeyData |
injectKEAPrivateKey(CryptoTokenCryptoSystemData cryptoSystemData,
byte[] data)
Inserts (or injects) the private key data onto the crypto token. |
|
CryptoTokenPublicKeyData |
injectKEAPublicKey(CryptoTokenCryptoSystemData cryptoSystemData,
byte[] data)
Inserts (or injects) the public key data onto the crypto token. |
|
boolean |
isSupported(CryptoSystem cryptoSystem,
int operation)
Indicates whether the chosen operation is supported by this CryptoToken using the provided CryptoSytem. |
|
boolean |
providesUserAuthentication()
Returns true if the token provides its own user authentication checks, eg a smartcard will prompt for a password before allowing access to the keys. |
|
void |
verifyKEACryptoSystemData(CryptoTokenCryptoSystemData cryptoSystemData)
Checks the validity of the crypto system parameters represented by this token. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KEACryptoToken()
KEACryptoToken
object.
This constructor is not used.
Method Detail |
---|
public final String getAlgorithm()
This method will always return the String "KEA".
getAlgorithm
in interface CryptoToken
public boolean providesUserAuthentication()
providesUserAuthentication
in interface CryptoToken
public int getKEACryptoSystemBitLength(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public String getKEACryptoSystemName(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] getKEACryptoSystemP(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] getKEACryptoSystemQ(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] getKEACryptoSystemG(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public int getKEAPublicKeyLength(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public int getKEAPrivateKeyLength(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] extractKEAPublicKeyData(CryptoTokenPublicKeyData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] extractKEAPublicKeyData(CryptoTokenPrivateKeyData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public byte[] extractKEAPrivateKeyData(CryptoTokenPrivateKeyData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto token or the crypto
token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public void verifyKEACryptoSystemData(CryptoTokenCryptoSystemData cryptoSystemData) throws CryptoTokenException, CryptoUnsupportedOperationException, InvalidCryptoSystemException
KEACryptoSystem.verify()
after it
has gone through the integrity tests for the
KEACryptoSystem
.
cryptoSystemData
- The data associated with the crypto system.
CryptoTokenException
- Thrown when an error occurs with a crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.
InvalidCryptoSystemException
- Thrown when the specified crypto
system is improperly formatted.public CryptoTokenCryptoSystemData getKEACryptoSystemData(byte[] p, byte[] q, byte[] g, String name) throws CryptoTokenException, CryptoUnsupportedOperationException, InvalidCryptoSystemException, UnsupportedCryptoSystemException
p
- A byte array containing the domain parameter p.q
- A byte array containing the domain parameter q.g
- A byte array containing the domain parameter g.name
- A String representing the name of the crypto system.
CryptoTokenCryptoSystemData
object associated
with the crypto token.
CryptoTokenException
- Thrown when an error occurs with a crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.
InvalidCryptoSystemException
- Thrown when the specified crypto
system is improperly formatted.
UnsupportedCryptoSystemException
- Thrown when the specified crypto
system is invalid.public KEAKeyPair createKEAKeyPair(CryptoTokenCryptoSystemData cryptoTokenData) throws CryptoTokenException, CryptoUnsupportedOperationException
cryptoTokenData
- The data associated with the crypto token.
CryptoTokenException
- Thrown when an error occurs with the crypto
token.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public CryptoTokenPublicKeyData injectKEAPublicKey(CryptoTokenCryptoSystemData cryptoSystemData, byte[] data) throws InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException
cryptoSystemData
- The data associated with the crypto ssystem.data
- A byte array containing the key data to be inserted onto the
token.
InvalidKeyException
- Thrown if the specified key is invalid or
improperly formed.
CryptoTokenException
- Thrown when an error occurs with the crypto
token.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public CryptoTokenPrivateKeyData injectKEAPrivateKey(CryptoTokenCryptoSystemData cryptoSystemData, byte[] data) throws InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException
cryptoSystemData
- The data associated with the crypto ssystem.data
- A byte array containing the key data to be inserted onto the
token.
InvalidKeyException
- Thrown if the specified key is invalid or
improperly formed.
CryptoTokenException
- Thrown when an error occurs with the crypto
token.
CryptoUnsupportedOperationException
- Thrown when a call is made to
an unsupported operation.public void deleteKEAPublicKey(CryptoTokenPublicKeyData data) throws CryptoTokenException, CryptoUnsupportedOperationException
data
- The key data contained within the token.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to
an unsupported operation.public void deleteKEAPrivateKey(CryptoTokenPrivateKeyData data) throws CryptoTokenException, CryptoUnsupportedOperationException
data
- The key data contained within the token.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to
an unsupported operation.public byte[] generateKEASharedSecret(CryptoTokenCryptoSystemData cryptoTokenCryptoSystemData, CryptoTokenPrivateKeyData cryptoTokenLocalStaticPrivateKeyData, CryptoTokenPrivateKeyData cryptoTokenLocalEphemeralPrivateKeyData, byte[] remoteStaticPublicKeyData, byte[] remoteEphemeralPublicKeyData) throws CryptoTokenException, CryptoUnsupportedOperationException, InvalidKeyException
cryptoTokenCryptoSystemData
- The crypto system data contained on
the token.cryptoTokenLocalStaticPrivateKeyData
- The local static private key to use.cryptoTokenLocalEphemeralPrivateKeyData
- The local ephemeral private key to use.remoteStaticPublicKeyData
- The remote static public key to use.remoteEphemeralPublicKeyData
- The remote ephemeral public key to use.
CryptoTokenException
- Thrown if an error occurs with the crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to
an unsupported operation.
InvalidKeyException
- Thrown if the calculated shared secret is not contained within the expected subgroup. This
may be thrown if a small subgroup attack is detected.public boolean isSupported(CryptoSystem cryptoSystem, int operation)
isSupported
in interface AsymmetricCryptoToken
cryptoSystem
- The CryptoSystem to check against.operation
- An integer, either KEY_GENERATION, PUBLIC_KEY_OPERATION, PRIVATE_KEY_OPERATION,
or some other value specific to the cryptosystem that indicates the operation to be checked.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal