/** * Return a predicate which matches any of the given key exchange schemes. * * @param keyAgreements the key exchange schemes * @return the predicate */ public static CipherSuitePredicate matchKeyExchange(KeyAgreement... keyAgreements) { keyAgreements = withoutNulls(keyAgreements); return keyAgreements == null || keyAgreements.length == 0 ? matchFalse() : keyAgreements.length == KeyAgreement.fullSize ? matchTrue() : new KeyAgreementCipherSuitePredicate(EnumSet.of(keyAgreements[0], keyAgreements)); }
/** * Return a predicate which matches any of the given security levels. * * @param levels the security levels * @return the predicate */ public static CipherSuitePredicate matchLevel(SecurityLevel... levels) { levels = withoutNulls(levels); return levels == null || levels.length == 0 ? matchFalse() : levels.length == SecurityLevel.fullSize ? matchTrue() : new LevelCipherSuitePredicate(EnumSet.of(levels[0], levels)); }
/** * Return a predicate which matches any of the given authentication schemes. * * @param authentications the authentication schemes * @return the predicate */ public static CipherSuitePredicate matchAuthentication(Authentication... authentications) { authentications = withoutNulls(authentications); return authentications == null || authentications.length == 0 ? matchFalse() : authentications.length == Authentication.fullSize ? matchTrue() : new AuthenticationCipherSuitePredicate(true, EnumSet.of(authentications[0], authentications)); }
/** * Return a predicate which matches any of the given protocols. * * @param protocols the protocols * @return the predicate */ public static CipherSuitePredicate matchProtocol(Protocol... protocols) { protocols = withoutNulls(protocols); return protocols == null || protocols.length == 0 ? matchFalse() : protocols.length == Protocol.fullSize ? matchTrue() : new ProtocolCipherSuitePredicate(EnumSet.of(protocols[0], protocols)); }
/** * Return a predicate which matches any of the given encryption schemes. * * @param encryptions the encryption schemes * @return the predicate */ public static CipherSuitePredicate matchEncryption(Encryption... encryptions) { encryptions = withoutNulls(encryptions); return encryptions == null || encryptions.length == 0 ? matchFalse() : encryptions.length == Encryption.fullSize ? matchTrue() : new EncryptionCipherSuitePredicate(EnumSet.of(encryptions[0], encryptions)); }
/** * Return a predicate which matches any of the given digest schemes. * * @param digests the digest schemes * @return the predicate */ public static CipherSuitePredicate matchDigest(Digest... digests) { digests = withoutNulls(digests); return digests == null || digests.length == 0 ? matchFalse() : digests.length == Digest.fullSize ? matchTrue() : new DigestCipherSuitePredicate(EnumSet.of(digests[0], digests)); }
/** * Return a predicate which matches any of the given authentication schemes. * * @param authentications the authentication schemes * @return the predicate */ public static CipherSuitePredicate matchAuthentication(Authentication... authentications) { authentications = withoutNulls(authentications); return authentications == null || authentications.length == 0 ? matchFalse() : authentications.length == Authentication.fullSize ? matchTrue() : new AuthenticationCipherSuitePredicate(true, EnumSet.of(authentications[0], authentications)); }
/** * Return a predicate which matches any of the given security levels. * * @param levels the security levels * @return the predicate */ public static CipherSuitePredicate matchLevel(SecurityLevel... levels) { levels = withoutNulls(levels); return levels == null || levels.length == 0 ? matchFalse() : levels.length == SecurityLevel.fullSize ? matchTrue() : new LevelCipherSuitePredicate(EnumSet.of(levels[0], levels)); }
/** * Return a predicate which matches any of the given encryption schemes. * * @param encryptions the encryption schemes * @return the predicate */ public static CipherSuitePredicate matchEncryption(Encryption... encryptions) { encryptions = withoutNulls(encryptions); return encryptions == null || encryptions.length == 0 ? matchFalse() : encryptions.length == Encryption.fullSize ? matchTrue() : new EncryptionCipherSuitePredicate(EnumSet.of(encryptions[0], encryptions)); }
/** * Return a predicate which matches any of the given key exchange schemes. * * @param keyAgreements the key exchange schemes * @return the predicate */ public static CipherSuitePredicate matchKeyExchange(KeyAgreement... keyAgreements) { keyAgreements = withoutNulls(keyAgreements); return keyAgreements == null || keyAgreements.length == 0 ? matchFalse() : keyAgreements.length == KeyAgreement.fullSize ? matchTrue() : new KeyAgreementCipherSuitePredicate(EnumSet.of(keyAgreements[0], keyAgreements)); }
/** * Return a predicate which matches any of the given security levels. * * @param levels the security levels * @return the predicate */ public static CipherSuitePredicate matchLevel(SecurityLevel... levels) { levels = withoutNulls(levels); return levels == null || levels.length == 0 ? matchFalse() : levels.length == SecurityLevel.fullSize ? matchTrue() : new LevelCipherSuitePredicate(EnumSet.of(levels[0], levels)); }
/** * Return a predicate which matches any of the given authentication schemes. * * @param authentications the authentication schemes * @return the predicate */ public static CipherSuitePredicate matchAuthentication(Authentication... authentications) { authentications = withoutNulls(authentications); return authentications == null || authentications.length == 0 ? matchFalse() : authentications.length == Authentication.fullSize ? matchTrue() : new AuthenticationCipherSuitePredicate(true, EnumSet.of(authentications[0], authentications)); }
/** * Return a predicate which matches any of the given digest schemes. * * @param digests the digest schemes * @return the predicate */ public static CipherSuitePredicate matchDigest(Digest... digests) { digests = withoutNulls(digests); return digests == null || digests.length == 0 ? matchFalse() : digests.length == Digest.fullSize ? matchTrue() : new DigestCipherSuitePredicate(EnumSet.of(digests[0], digests)); }
/** * Return a predicate which matches any of the given protocols. * * @param protocols the protocols * @return the predicate */ public static CipherSuitePredicate matchProtocol(Protocol... protocols) { protocols = withoutNulls(protocols); return protocols == null || protocols.length == 0 ? matchFalse() : protocols.length == Protocol.fullSize ? matchTrue() : new ProtocolCipherSuitePredicate(EnumSet.of(protocols[0], protocols)); }
/** * Return a predicate which matches any of the given protocols. * * @param protocols the protocols * @return the predicate */ public static CipherSuitePredicate matchProtocol(Protocol... protocols) { protocols = withoutNulls(protocols); return protocols == null || protocols.length == 0 ? matchFalse() : protocols.length == Protocol.fullSize ? matchTrue() : new ProtocolCipherSuitePredicate(EnumSet.of(protocols[0], protocols)); }
/** * Return a predicate which matches any of the given security levels. * * @param levels the security levels * @return the predicate */ public static CipherSuitePredicate matchLevel(SecurityLevel... levels) { levels = withoutNulls(levels); return levels == null || levels.length == 0 ? matchFalse() : levels.length == SecurityLevel.fullSize ? matchTrue() : new LevelCipherSuitePredicate(EnumSet.of(levels[0], levels)); }
/** * Return a predicate which matches any of the given digest schemes. * * @param digests the digest schemes * @return the predicate */ public static CipherSuitePredicate matchDigest(Digest... digests) { digests = withoutNulls(digests); return digests == null || digests.length == 0 ? matchFalse() : digests.length == Digest.fullSize ? matchTrue() : new DigestCipherSuitePredicate(EnumSet.of(digests[0], digests)); }
/** * Return a predicate which matches any of the given encryption schemes. * * @param encryptions the encryption schemes * @return the predicate */ public static CipherSuitePredicate matchEncryption(Encryption... encryptions) { encryptions = withoutNulls(encryptions); return encryptions == null || encryptions.length == 0 ? matchFalse() : encryptions.length == Encryption.fullSize ? matchTrue() : new EncryptionCipherSuitePredicate(EnumSet.of(encryptions[0], encryptions)); }
/** * Return a predicate which matches any of the given key exchange schemes. * * @param keyAgreements the key exchange schemes * @return the predicate */ public static CipherSuitePredicate matchKeyExchange(KeyAgreement... keyAgreements) { keyAgreements = withoutNulls(keyAgreements); return keyAgreements == null || keyAgreements.length == 0 ? matchFalse() : keyAgreements.length == KeyAgreement.fullSize ? matchTrue() : new KeyAgreementCipherSuitePredicate(EnumSet.of(keyAgreements[0], keyAgreements)); }
/** * Return a predicate which matches any of the given authentication schemes. * * @param authentications the authentication schemes * @return the predicate */ public static CipherSuitePredicate matchAuthentication(Authentication... authentications) { authentications = withoutNulls(authentications); return authentications == null || authentications.length == 0 ? matchFalse() : authentications.length == Authentication.fullSize ? matchTrue() : new AuthenticationCipherSuitePredicate(true, EnumSet.of(authentications[0], authentications)); }