Package com.biglybt.core.security
Interface CryptoHandler
-
- All Known Implementing Classes:
CryptoHandlerECC
public interface CryptoHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decrypt(byte[] other_public_key, byte[] data, java.lang.String reason)
byte[]
encrypt(byte[] other_public_key, byte[] data, java.lang.String reason)
java.lang.String
exportKeys()
int
getDefaultPasswordHandlerType()
byte[]
getEncryptedPrivateKey(java.lang.String reason)
int
getInstance()
byte[]
getPublicKey(java.lang.String reason)
CryptoSTSEngine
getSTSEngine(java.lang.String reason)
CryptoSTSEngine
getSTSEngine(java.security.PublicKey public_key, java.security.PrivateKey private_key)
int
getType()
int
getUnlockTimeoutSeconds()
boolean
importKeys(java.lang.String str)
boolean
isUnlocked()
void
lock()
Puts the handler back into a state where password will be required to access private stuffbyte[]
peekPublicKey()
void
recoverKeys(byte[] public_key, byte[] encrypted_private_key)
void
resetKeys(java.lang.String reason)
void
setDefaultPasswordHandlerType(int new_type)
void
setUnlockTimeoutSeconds(int secs)
byte[]
sign(byte[] data, java.lang.String reason)
void
unlock()
Explicit unlock requestboolean
verify(byte[] public_key, byte[] data, byte[] signature)
boolean
verifyPublicKey(byte[] encoded)
-
-
-
Method Detail
-
getType
int getType()
-
getInstance
int getInstance()
-
unlock
void unlock() throws CryptoManagerException
Explicit unlock request- Throws:
CryptoManagerException
-
lock
void lock()
Puts the handler back into a state where password will be required to access private stuff
-
isUnlocked
boolean isUnlocked()
-
getUnlockTimeoutSeconds
int getUnlockTimeoutSeconds()
-
setUnlockTimeoutSeconds
void setUnlockTimeoutSeconds(int secs)
- Parameters:
secs
- 0-> infinite
-
sign
byte[] sign(byte[] data, java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
verify
boolean verify(byte[] public_key, byte[] data, byte[] signature) throws CryptoManagerException
- Throws:
CryptoManagerException
-
encrypt
byte[] encrypt(byte[] other_public_key, byte[] data, java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
decrypt
byte[] decrypt(byte[] other_public_key, byte[] data, java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
getSTSEngine
CryptoSTSEngine getSTSEngine(java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
getSTSEngine
CryptoSTSEngine getSTSEngine(java.security.PublicKey public_key, java.security.PrivateKey private_key) throws CryptoManagerException
- Throws:
CryptoManagerException
-
peekPublicKey
byte[] peekPublicKey()
-
getPublicKey
byte[] getPublicKey(java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
getEncryptedPrivateKey
byte[] getEncryptedPrivateKey(java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
verifyPublicKey
boolean verifyPublicKey(byte[] encoded)
-
recoverKeys
void recoverKeys(byte[] public_key, byte[] encrypted_private_key) throws CryptoManagerException
- Throws:
CryptoManagerException
-
resetKeys
void resetKeys(java.lang.String reason) throws CryptoManagerException
- Throws:
CryptoManagerException
-
exportKeys
java.lang.String exportKeys() throws CryptoManagerException
- Throws:
CryptoManagerException
-
getDefaultPasswordHandlerType
int getDefaultPasswordHandlerType()
-
setDefaultPasswordHandlerType
void setDefaultPasswordHandlerType(int new_type) throws CryptoManagerException
- Throws:
CryptoManagerException
-
importKeys
boolean importKeys(java.lang.String str) throws CryptoManagerException
- Parameters:
str
-- Returns:
- true if a client restart is required
- Throws:
CryptoManagerException
-
-