|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.smslib.crypto.KeyManager
public class KeyManager
The KeyManager class handles the association of a number (originator or recipient) with a cryptographic key.
Method Summary | |
---|---|
byte[] |
decrypt(java.lang.String mobileNumber,
byte[] message)
Decrypts the specified message with the encryption key already associated with the specified mobile number. |
byte[] |
encrypt(java.lang.String mobileNumber,
byte[] message)
Encrypts the specified message with the encryption key already associated with the specified mobile number. |
static KeyManager |
getInstance()
|
AKey |
getKey(java.lang.String mobileNumber)
Returns the encryption key of the specified mobile number. |
void |
registerKey(java.lang.String mobileNumber,
AKey key)
Associates a mobile number with an encryption key. |
void |
unregisterAllKeys()
Removes all associations of mobile numbers and encryption keys. |
AKey |
unregisterKey(java.lang.String mobileNumber)
Removes the association of a mobile number with a key. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static KeyManager getInstance()
public void registerKey(java.lang.String mobileNumber, AKey key)
mobileNumber
- The mobile number which will be associated with the encryption
key.key
- The encryption key.AKey
,
registerKey(String, AKey)
,
unregisterAllKeys()
public AKey unregisterKey(java.lang.String mobileNumber)
mobileNumber
- The mobile number which will be removed from the key
associations.
AKey
,
registerKey(String, AKey)
public void unregisterAllKeys()
public AKey getKey(java.lang.String mobileNumber)
mobileNumber
- The mobile number to look for.
public byte[] encrypt(java.lang.String mobileNumber, byte[] message) throws SMSLibException, java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException
mobileNumber
- The mobile number which the message will be send to / received
from.message
- The decrypted message.
SMSLibException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmException
public byte[] decrypt(java.lang.String mobileNumber, byte[] message) throws SMSLibException, java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException
mobileNumber
- The mobile number which the message received from.message
- The encrypted message.
SMSLibException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmException
|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |