public class OtrCryptoEngineImpl extends Object implements OtrCryptoEngine
AES_KEY_BYTE_LENGTH, BIGINTEGER_TWO, DH_PRIVATE_KEY_MINIMUM_BIT_LENGTH, DSA_PUB_TYPE, GENERATOR, GENERATOR_TEXT, MODULUS, MODULUS_MINUS_TWO, MODULUS_TEXT, SHA256_HMAC_KEY_BYTE_LENGTH, ZERO_CTR| Constructor and Description |
|---|
OtrCryptoEngineImpl() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
aesDecrypt(byte[] key,
byte[] ctr,
byte[] b) |
byte[] |
aesEncrypt(byte[] key,
byte[] ctr,
byte[] b) |
KeyPair |
generateDHKeyPair() |
BigInteger |
generateSecret(PrivateKey privKey,
PublicKey pubKey) |
DHPublicKey |
getDHPublicKey(BigInteger mpi) |
DHPublicKey |
getDHPublicKey(byte[] mpiBytes) |
String |
getFingerprint(PublicKey pubKey) |
byte[] |
getFingerprintRaw(PublicKey pubKey) |
byte[] |
sha1Hash(byte[] b) |
byte[] |
sha1Hmac(byte[] b,
byte[] key,
int length) |
byte[] |
sha256Hash(byte[] b) |
byte[] |
sha256Hmac(byte[] b,
byte[] key) |
byte[] |
sha256Hmac(byte[] b,
byte[] key,
int length) |
byte[] |
sha256Hmac160(byte[] b,
byte[] key) |
byte[] |
sign(byte[] b,
PrivateKey privatekey) |
boolean |
verify(byte[] b,
PublicKey pubKey,
byte[] rs) |
public KeyPair generateDHKeyPair() throws OtrCryptoException
generateDHKeyPair in interface OtrCryptoEngineOtrCryptoExceptionpublic DHPublicKey getDHPublicKey(byte[] mpiBytes) throws OtrCryptoException
getDHPublicKey in interface OtrCryptoEngineOtrCryptoExceptionpublic DHPublicKey getDHPublicKey(BigInteger mpi) throws OtrCryptoException
getDHPublicKey in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha256Hmac(byte[] b,
byte[] key)
throws OtrCryptoException
sha256Hmac in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha256Hmac(byte[] b,
byte[] key,
int length)
throws OtrCryptoException
sha256Hmac in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha1Hmac(byte[] b,
byte[] key,
int length)
throws OtrCryptoException
sha1Hmac in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha256Hmac160(byte[] b,
byte[] key)
throws OtrCryptoException
sha256Hmac160 in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha256Hash(byte[] b)
throws OtrCryptoException
sha256Hash in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sha1Hash(byte[] b)
throws OtrCryptoException
sha1Hash in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] aesDecrypt(byte[] key,
byte[] ctr,
byte[] b)
throws OtrCryptoException
aesDecrypt in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] aesEncrypt(byte[] key,
byte[] ctr,
byte[] b)
throws OtrCryptoException
aesEncrypt in interface OtrCryptoEngineOtrCryptoExceptionpublic BigInteger generateSecret(PrivateKey privKey, PublicKey pubKey) throws OtrCryptoException
generateSecret in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] sign(byte[] b,
PrivateKey privatekey)
throws OtrCryptoException
sign in interface OtrCryptoEngineOtrCryptoExceptionpublic boolean verify(byte[] b,
PublicKey pubKey,
byte[] rs)
throws OtrCryptoException
verify in interface OtrCryptoEngineOtrCryptoExceptionpublic String getFingerprint(PublicKey pubKey) throws OtrCryptoException
getFingerprint in interface OtrCryptoEngineOtrCryptoExceptionpublic byte[] getFingerprintRaw(PublicKey pubKey) throws OtrCryptoException
getFingerprintRaw in interface OtrCryptoEngineOtrCryptoExceptionCopyright © 2015. All rights reserved.