Class SaslPrep
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.encryption.SaslPrep
-
class SaslPrep extends java.lang.Object
Copied from https://github.com/tombentley/saslprep/blob/master/src/main/java/SaslPrep.java on 30.5.2019, commit 2e30daa.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SaslPrep()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static boolean
asciiControl(char ch)
Return true if the givench
is an ASCII control character as defined by RFC 3454, Appendix C.2.1.private static boolean
changeDisplayProperties(int codepoint)
Return true if the givencodepoint
is change display properties or deprecated characters as defined by RFC 3454, Appendix C.8.private static boolean
inappropriateForCanonical(int codepoint)
Return true if the givencodepoint
is inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.private static boolean
inappropriateForPlainText(int codepoint)
Return true if the givencodepoint
is inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.private static boolean
mappedToNothing(char ch)
Return true if the givench
is a "commonly mapped to nothing" character as defined by RFC 3454, Appendix B.1.private static boolean
nonAsciiControl(int codepoint)
Return true if the givench
is a non-ASCII control character as defined by RFC 3454, Appendix C.2.2.private static boolean
nonAsciiSpace(char ch)
Return true if the givench
is a non-ASCII space character as defined by RFC 3454, Appendix C.1.2.private static boolean
nonCharacterCodePoint(int codepoint)
Return true if the givencodepoint
is a non-character code point as defined by RFC 3454, Appendix C.4.private static boolean
privateUse(int codepoint)
Return true if the givencodepoint
is a private use character as defined by RFC 3454, Appendix C.3.(package private) static boolean
prohibited(int codepoint)
Return true if the givencodepoint
is a prohibited character as defined by RFC 4013, Section 2.3.private static java.lang.String
saslPrep(java.lang.String str, boolean allowUnassigned)
(package private) static java.lang.String
saslPrepQuery(java.lang.String str)
Return theSASLPrep
-canonicalised version of the givenstr
for use as a query string.(package private) static java.lang.String
saslPrepStored(java.lang.String str)
Return theSASLPrep
-canonicalised version of the givenprivate static boolean
surrogateCodePoint(int codepoint)
Return true if the givencodepoint
is a surrogate code point as defined by RFC 3454, Appendix C.5.private static boolean
tagging(int codepoint)
Return true if the givencodepoint
is a tagging character as defined by RFC 3454, Appendix C.9.
-
-
-
Method Detail
-
saslPrepQuery
static java.lang.String saslPrepQuery(java.lang.String str)
Return theSASLPrep
-canonicalised version of the givenstr
for use as a query string. This implements theSASLPrep
algorithm 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.- See Also:
- RFC 3454, Section 7 for discussion of what a query string is.
-
saslPrepStored
static java.lang.String saslPrepStored(java.lang.String str)
Return theSASLPrep
-canonicalised version of the given
-
saslPrep
private static java.lang.String saslPrep(java.lang.String str, boolean allowUnassigned)
-
prohibited
static boolean prohibited(int codepoint)
Return true if the givencodepoint
is a prohibited character as defined by RFC 4013, Section 2.3.
-
tagging
private static boolean tagging(int codepoint)
Return true if the givencodepoint
is a tagging character as defined by RFC 3454, Appendix C.9.
-
changeDisplayProperties
private static boolean changeDisplayProperties(int codepoint)
Return true if the givencodepoint
is 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 givencodepoint
is inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.
-
inappropriateForPlainText
private static boolean inappropriateForPlainText(int codepoint)
Return true if the givencodepoint
is inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.
-
surrogateCodePoint
private static boolean surrogateCodePoint(int codepoint)
Return true if the givencodepoint
is a surrogate code point as defined by RFC 3454, Appendix C.5.
-
nonCharacterCodePoint
private static boolean nonCharacterCodePoint(int codepoint)
Return true if the givencodepoint
is a non-character code point as defined by RFC 3454, Appendix C.4.
-
privateUse
private static boolean privateUse(int codepoint)
Return true if the givencodepoint
is a private use character as defined by RFC 3454, Appendix C.3.
-
nonAsciiControl
private static boolean nonAsciiControl(int codepoint)
Return true if the givench
is 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 givench
is an ASCII control character as defined by RFC 3454, Appendix C.2.1.
-
nonAsciiSpace
private static boolean nonAsciiSpace(char ch)
Return true if the givench
is 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 givench
is a "commonly mapped to nothing" character as defined by RFC 3454, Appendix B.1.
-
-