|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcrypto.CipherEngine
public class CipherEngine
Common ciphering engine (for the whole application) providing: - Asymmetric ciphering: used for signing/verification and encryption/decryption of secret key used in symmetric ciphering. - Symmetric ciphering: used for encryption/decryption of PDUs and secret chat text messages.
Field Summary | |
---|---|
private static java.lang.String |
defaultPrivateKeyDirectory
Subdirectory of the user.home where private key is stored |
private static java.lang.String |
myCipherAlgorithm
The default cipher algorithm for data (PDUs and secret chat messages) |
private static int |
myCipherKeySize
The default key size for cipher algorithm |
private static SymmetricCipher |
myPduCipher
Symmetric cipher used to encrypt data (PDUs and secret chat messages) |
private static java.lang.String |
myPrivateKeyPath
Full path of the directory holding our private key |
private static AsymmetricCipher |
privateCipher
Asymmetric cipher used to encrypt secret keys |
Constructor Summary | |
---|---|
CipherEngine()
|
Method Summary | |
---|---|
static SymmetricCipher |
deserializeEncryptedSecretKey(java.lang.String encryptedSecret)
Reconstructs secret key from Base64 respresentation of encrypted (using our public key) serialized secret key and verifies signature of the remote peer. |
static boolean |
generateNewSecret(java.lang.String algorithm,
int keySize,
boolean verbose)
Generates new symmetric secret key. |
static SymmetricCipher |
getCipher()
Returns local symmetric ciphering engine |
static java.lang.String |
getNamedPublicKey()
Returns serialized named public key encoded as Base64 string. |
static java.lang.String |
getPrivateKeyDirectory()
Returns path to the directory holding our private key |
static java.lang.String |
getSignedPublicKey()
Returns serialized signed public key (used for encryption of datagrams) as Base64 string. |
static java.security.SignedObject |
getSignedSecretKey()
Returns secret key signed with our private key |
static void |
initialize()
Loads authorized public keys and initializes asymmetric and symmetric ciphering engines, where: - Asymmetric ciphering is used for verification and encryption/decryption of secret key used in symmetric ciphering |
static void |
reloadAuthorizedPublicKeys()
Reloads only authorized public keys |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static AsymmetricCipher privateCipher
private static final java.lang.String myCipherAlgorithm
private static final int myCipherKeySize
private static final java.lang.String defaultPrivateKeyDirectory
private static java.lang.String myPrivateKeyPath
private static SymmetricCipher myPduCipher
Constructor Detail |
---|
public CipherEngine()
Method Detail |
---|
public static java.lang.String getPrivateKeyDirectory()
public static java.lang.String getSignedPublicKey()
public static java.lang.String getNamedPublicKey()
public static SymmetricCipher getCipher()
public static java.security.SignedObject getSignedSecretKey()
public static SymmetricCipher deserializeEncryptedSecretKey(java.lang.String encryptedSecret)
public static void initialize()
public static void reloadAuthorizedPublicKeys()
public static boolean generateNewSecret(java.lang.String algorithm, int keySize, boolean verbose)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |