Top Description Constructors Methods
org.apache.pdfbox.pdmodel.encryption

pack-priv Class SaslPrep

extends Object
Class Inheritance
Imports
java.nio.CharBuffer, java.text.Normalizer

Copied from https://github.com/tombentley/saslprep/blob/master/src/main/java/SaslPrep.java on 30.5.2019, commit 2e30daa.
Author
Tom Bentley

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
asciiControl(char ch)

Return true if the given ch is an ASCII control character as defined by RFC 3454, Appendix C.2.1.

private static boolean
changeDisplayProperties(int codepoint)

Return true if the given codepoint 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 given codepoint is inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.

private static boolean
inappropriateForPlainText(int codepoint)

Return true if the given codepoint is inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.

private static boolean
mappedToNothing(char ch)

Return true if the given ch 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 given ch 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 given ch 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 given codepoint is a non-character code point as defined by RFC 3454, Appendix C.4.

private static boolean
privateUse(int codepoint)

Return true if the given codepoint is a private use character as defined by RFC 3454, Appendix C.3.

pack-priv static boolean
prohibited(int codepoint)

Return true if the given codepoint is a prohibited character as defined by RFC 4013, Section 2.3.

private static String
saslPrep(String str, boolean allowUnassigned)

pack-priv static String

Returns:

The canonicalised string.
saslPrepQuery
(String
The string to canonicalise.
str
)

Return the SASLPrep-canonicalised version of the given str for use as a query string.

pack-priv static String

Returns:

The canonicalised string.
saslPrepStored
(String
The string to canonicalise.
str
)

Return the SASLPrep-canonicalised version of the given

private static boolean
surrogateCodePoint(int codepoint)

Return true if the given codepoint is a surrogate code point as defined by RFC 3454, Appendix C.5.

private static boolean
tagging(int codepoint)

Return true if the given codepoint is a tagging character as defined by RFC 3454, Appendix C.9.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SaslPrepback to summary
private SaslPrep()

Method Detail

asciiControlback to summary
private static boolean asciiControl(char ch)

Return true if the given ch is an ASCII control character as defined by RFC 3454, Appendix C.2.1.

changeDisplayPropertiesback to summary
private static boolean changeDisplayProperties(int codepoint)

Return true if the given codepoint is change display properties or deprecated characters as defined by RFC 3454, Appendix C.8.

inappropriateForCanonicalback to summary
private static boolean inappropriateForCanonical(int codepoint)

Return true if the given codepoint is inappropriate for canonical representation characters as defined by RFC 3454, Appendix C.7.

inappropriateForPlainTextback to summary
private static boolean inappropriateForPlainText(int codepoint)

Return true if the given codepoint is inappropriate for plain text characters as defined by RFC 3454, Appendix C.6.

mappedToNothingback to summary
private static boolean mappedToNothing(char ch)

Return true if the given ch is a "commonly mapped to nothing" character as defined by RFC 3454, Appendix B.1.

nonAsciiControlback to summary
private static boolean nonAsciiControl(int codepoint)

Return true if the given ch is a non-ASCII control character as defined by RFC 3454, Appendix C.2.2.

nonAsciiSpaceback to summary
private static boolean nonAsciiSpace(char ch)

Return true if the given ch is a non-ASCII space character as defined by RFC 3454, Appendix C.1.2.

nonCharacterCodePointback to summary
private static boolean nonCharacterCodePoint(int codepoint)

Return true if the given codepoint is a non-character code point as defined by RFC 3454, Appendix C.4.

privateUseback to summary
private static boolean privateUse(int codepoint)

Return true if the given codepoint is a private use character as defined by RFC 3454, Appendix C.3.

prohibitedback to summary
pack-priv static boolean prohibited(int codepoint)

Return true if the given codepoint is a prohibited character as defined by RFC 4013, Section 2.3.

saslPrepback to summary
private static String saslPrep(String str, boolean allowUnassigned)
saslPrepQueryback to summary
pack-priv static String saslPrepQuery(String str)

Return the SASLPrep-canonicalised version of the given str for use as a query string. This implements the SASLPrep algorithm defined in RFC 4013.

Parameters
str:String

The string to canonicalise.

Returns:String

The canonicalised string.

Exceptions
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.
saslPrepStoredback to summary
pack-priv static String saslPrepStored(String str)

Return the SASLPrep-canonicalised version of the given

Parameters
str:String

The string to canonicalise.

Returns:String

The canonicalised string.

Exceptions
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 stored string is.
surrogateCodePointback to summary
private static boolean surrogateCodePoint(int codepoint)

Return true if the given codepoint is a surrogate code point as defined by RFC 3454, Appendix C.5.

taggingback to summary
private static boolean tagging(int codepoint)

Return true if the given codepoint is a tagging character as defined by RFC 3454, Appendix C.9.