bt.protocol.crypto.EncryptionPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bt-core Show documentation
Show all versions of bt-core Show documentation
BitTorrent Client Library (Core)
package bt.protocol.crypto;
/**
* Message Stream Encryption policy
*
* @since 1.2
*/
public enum EncryptionPolicy {
/**
* @since 1.2
*/
REQUIRE_PLAINTEXT,
/**
* @since 1.2
*/
PREFER_PLAINTEXT,
/**
* @since 1.2
*/
PREFER_ENCRYPTED,
/**
* @since 1.2
*/
REQUIRE_ENCRYPTED;
public boolean isCompatible(EncryptionPolicy that) {
if (this == REQUIRE_PLAINTEXT && that == REQUIRE_ENCRYPTED) {
return false;
} else if (this == REQUIRE_ENCRYPTED && that == REQUIRE_PLAINTEXT) {
return false;
}
return true;
}
}