Class SaslPrep
- java.lang.Object
-
- com.ongres.scram.common.stringprep.SaslPrep
-
public class SaslPrep extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSaslPrep()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleanasciiControl(char ch)Return true if the givenchis an ASCII control character as defined by RFC 3454, Appendix C.2.1.private static booleanchangeDisplayProperties(int codepoint)Return true if the givencodepointis change display properties or deprecated characters as defined by RFC 3454, Appendix C.8.private static booleaninappropriateForCanonical(int codepoint)Return true if the givencodepointis inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.private static booleaninappropriateForPlainText(int codepoint)Return true if the givencodepointis inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.private static booleanmappedToNothing(char ch)Return true if the givenchis a "commonly mapped to nothing" character as defined by RFC 3454, Appendix B.1.private static booleannonAsciiControl(int codepoint)Return true if the givenchis a non-ASCII control character as defined by RFC 3454, Appendix C.2.2.private static booleannonAsciiSpace(char ch)Return true if the givenchis a non-ASCII space character as defined by RFC 3454, Appendix C.1.2.private static booleannonCharacterCodePoint(int codepoint)Return true if the givencodepointis a non-character code point as defined by RFC 3454, Appendix C.4.private static booleanprivateUse(int codepoint)Return true if the givencodepointis a private use character as defined by RFC 3454, Appendix C.3.(package private) static booleanprohibited(int codepoint)Return true if the givencodepointis a prohibited character as defined by RFC 4013, Section 2.3.static java.lang.StringsaslPrep(java.lang.String str)Return theSASLPrep-canonicalised version of the givenstrfor use as a query string.private static booleansurrogateCodePoint(int codepoint)Return true if the givencodepointis a surrogate code point as defined by RFC 3454, Appendix C.5.private static booleantagging(int codepoint)Return true if the givencodepointis a tagging character as defined by RFC 3454, Appendix C.9.
-
-
-
Method Detail
-
saslPrep
public static java.lang.String saslPrep(java.lang.String str)
Return theSASLPrep-canonicalised version of the givenstrfor use as a query string. This implements theSASLPrepalgorithm defined in RFC 4013.- Parameters:
str- The string to canonicalise.- Returns:
- The canonicalised string.
- Throws:
java.lang.IllegalArgumentException- if the string contained prohibited codepoints, or broke the requirements for bidirectional character handling.
-
prohibited
static boolean prohibited(int codepoint)
Return true if the givencodepointis a prohibited character as defined by RFC 4013, Section 2.3.
-
tagging
private static boolean tagging(int codepoint)
Return true if the givencodepointis a tagging character as defined by RFC 3454, Appendix C.9.
-
changeDisplayProperties
private static boolean changeDisplayProperties(int codepoint)
Return true if the givencodepointis change display properties or deprecated characters as defined by RFC 3454, Appendix C.8.
-
inappropriateForCanonical
private static boolean inappropriateForCanonical(int codepoint)
Return true if the givencodepointis inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.
-
inappropriateForPlainText
private static boolean inappropriateForPlainText(int codepoint)
Return true if the givencodepointis inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.
-
surrogateCodePoint
private static boolean surrogateCodePoint(int codepoint)
Return true if the givencodepointis a surrogate code point as defined by RFC 3454, Appendix C.5.
-
nonCharacterCodePoint
private static boolean nonCharacterCodePoint(int codepoint)
Return true if the givencodepointis a non-character code point as defined by RFC 3454, Appendix C.4.
-
privateUse
private static boolean privateUse(int codepoint)
Return true if the givencodepointis a private use character as defined by RFC 3454, Appendix C.3.
-
nonAsciiControl
private static boolean nonAsciiControl(int codepoint)
Return true if the givenchis a non-ASCII control character as defined by RFC 3454, Appendix C.2.2.
-
asciiControl
private static boolean asciiControl(char ch)
Return true if the givenchis an ASCII control character as defined by RFC 3454, Appendix C.2.1.
-
nonAsciiSpace
private static boolean nonAsciiSpace(char ch)
Return true if the givenchis a non-ASCII space character as defined by RFC 3454, Appendix C.1.2.
-
mappedToNothing
private static boolean mappedToNothing(char ch)
Return true if the givenchis a "commonly mapped to nothing" character as defined by RFC 3454, Appendix B.1.
-
-