public class MSECipher extends Object
getEncryptionCipher()
and getDecryptionCipher()
will be different, depending on which of the factory methods was used to build an instance of this class:
- connection initiating side should use forInitiator(byte[], TorrentId)
factory method
- receiver of connection request should use forReceiver(byte[], TorrentId)
factory methodModifier and Type | Method and Description |
---|---|
static MSECipher |
forInitiator(byte[] S,
TorrentId torrentId)
Create MSE cipher for connection initiator
|
static MSECipher |
forReceiver(byte[] S,
TorrentId torrentId)
Create MSE cipher for receiver of the connection request
|
Cipher |
getDecryptionCipher() |
Cipher |
getEncryptionCipher() |
static boolean |
isKeySizeSupported(int keySize) |
public static boolean isKeySizeSupported(int keySize) throws BtException
BtException
- if the check can't be performed,
e.g. when the MSE-specific cipher transformation is not supported in the current JDK.public static MSECipher forInitiator(byte[] S, TorrentId torrentId)
S
- Shared secrettorrentId
- Torrent idpublic static MSECipher forReceiver(byte[] S, TorrentId torrentId)
S
- Shared secrettorrentId
- Torrent idpublic Cipher getEncryptionCipher()
public Cipher getDecryptionCipher()
Copyright © 2016–2021. All rights reserved.