Class SaslPrep

java.lang.Object
org.apache.pdfbox.pdmodel.encryption.SaslPrep

class SaslPrep extends Object
Copied from https://github.com/tombentley/saslprep/blob/master/src/main/java/SaslPrep.java on 30.5.2019, commit 2e30daa.
  • Constructor Details

    • SaslPrep

      private SaslPrep()
  • Method Details

    • saslPrepQuery

      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 - The string to canonicalise.
      Returns:
      The canonicalised string.
      Throws:
      IllegalArgumentException - if the string contained prohibited codepoints, or broke the requirements for bidirectional character handling.
      See Also:
    • saslPrepStored

      static String saslPrepStored(String str)
      Return the SASLPrep-canonicalised version of the given
    • saslPrep

      private static String saslPrep(String str, boolean allowUnassigned)
    • prohibited

      static boolean prohibited(int codepoint)
      Return true if the given codepoint is a prohibited character as defined by RFC 4013, Section 2.3.
    • tagging

      private static boolean tagging(int codepoint)
      Return true if the given codepoint is a tagging character as defined by RFC 3454, Appendix C.9.
    • changeDisplayProperties

      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.
    • inappropriateForCanonical

      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.
    • inappropriateForPlainText

      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.
    • surrogateCodePoint

      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.
    • nonCharacterCodePoint

      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.
    • privateUse

      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.
    • nonAsciiControl

      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.
    • asciiControl

      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.
    • nonAsciiSpace

      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.
    • mappedToNothing

      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.