Package com.biglybt.core.security
Interface CryptoHandler
- All Known Implementing Classes:
CryptoHandlerECC
public interface CryptoHandler
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
byte[]
int
byte[]
getEncryptedPrivateKey
(String reason) int
byte[]
getPublicKey
(String reason) getSTSEngine
(String reason) getSTSEngine
(PublicKey public_key, PrivateKey private_key) int
getType()
int
boolean
importKeys
(String str) boolean
void
lock()
Puts the handler back into a state where password will be required to access private stuffbyte[]
void
recoverKeys
(byte[] public_key, byte[] encrypted_private_key) void
void
setDefaultPasswordHandlerType
(int new_type) void
setUnlockTimeoutSeconds
(int secs) byte[]
void
unlock()
Explicit unlock requestboolean
verify
(byte[] public_key, byte[] data, byte[] signature) boolean
verifyPublicKey
(byte[] encoded)
-
Method Details
-
getType
int getType() -
getInstance
int getInstance() -
unlock
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
- Throws:
CryptoManagerException
-
verify
- Throws:
CryptoManagerException
-
encrypt
- Throws:
CryptoManagerException
-
decrypt
- Throws:
CryptoManagerException
-
getSTSEngine
- Throws:
CryptoManagerException
-
getSTSEngine
CryptoSTSEngine getSTSEngine(PublicKey public_key, PrivateKey private_key) throws CryptoManagerException - Throws:
CryptoManagerException
-
peekPublicKey
byte[] peekPublicKey() -
getPublicKey
- Throws:
CryptoManagerException
-
getEncryptedPrivateKey
- Throws:
CryptoManagerException
-
verifyPublicKey
boolean verifyPublicKey(byte[] encoded) -
recoverKeys
- Throws:
CryptoManagerException
-
resetKeys
- Throws:
CryptoManagerException
-
exportKeys
- Throws:
CryptoManagerException
-
getDefaultPasswordHandlerType
int getDefaultPasswordHandlerType() -
setDefaultPasswordHandlerType
- Throws:
CryptoManagerException
-
importKeys
- Parameters:
str
-- Returns:
- true if a client restart is required
- Throws:
CryptoManagerException
-