All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bt.protocol.crypto.EncryptionPolicy Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy