Class AbstractDigestMechanism

    • Field Detail

      • NONCE_SIZE

        private static int NONCE_SIZE
      • CIPHER_OPTS

        public static final String[] CIPHER_OPTS
      • digestURI

        protected final String digestURI
      • charset

        protected Charset charset
      • cipher

        protected String cipher
      • wrapSeqNum

        protected int wrapSeqNum
      • unwrapSeqNum

        protected int unwrapSeqNum
      • nonce

        protected byte[] nonce
      • cnonce

        protected byte[] cnonce
      • username

        protected String username
      • realm

        protected String realm
      • authorizationId

        protected String authorizationId
      • hA1

        protected byte[] hA1
      • secureRandomGenerator

        protected SecureRandom secureRandomGenerator
      • hmacMD5

        protected Mac hmacMD5
      • wrapCipher

        protected Cipher wrapCipher
      • unwrapCipher

        protected Cipher unwrapCipher
      • wrapHmacKeyIntegrity

        protected byte[] wrapHmacKeyIntegrity
      • unwrapHmacKeyIntegrity

        protected byte[] unwrapHmacKeyIntegrity
    • Method Detail

      • getSupportedCiphers

        static String getSupportedCiphers​(String[] demandedCiphers)
        Get supported ciphers as comma separated list of cipher-opts by Digest MD5 spec.
        Returns:
        comma separated list of ciphers
      • generateNonce

        static byte[] generateNonce()
      • arrayContains

        protected boolean arrayContains​(String[] array,
                                        String searched)
      • getCharset

        public Charset getCharset()
      • handleUserRealmPasswordCallbacks

        byte[] handleUserRealmPasswordCallbacks​(String[] realms,
                                                boolean readOnlyRealmUsername,
                                                boolean skipRealmCallbacks)
                                         throws SaslException
        Throws:
        SaslException
      • wrapIntegrityProtectedMessage

        private byte[] wrapIntegrityProtectedMessage​(byte[] message,
                                                     int offset,
                                                     int len)
                                              throws SaslException
        Throws:
        SaslException
      • unwrapIntegrityProtectedMessage

        private byte[] unwrapIntegrityProtectedMessage​(byte[] message,
                                                       int offset,
                                                       int len)
                                                throws SaslException
        Throws:
        SaslException
      • wrapConfidentialityProtectedMessage

        private byte[] wrapConfidentialityProtectedMessage​(byte[] message,
                                                           int offset,
                                                           int len)
                                                    throws SaslException
        Throws:
        SaslException
      • unwrapConfidentialityProtectedMessage

        private byte[] unwrapConfidentialityProtectedMessage​(byte[] message,
                                                             int offset,
                                                             int len)
                                                      throws SaslException
        Throws:
        SaslException
      • createIntegrityKey

        protected byte[] createIntegrityKey​(boolean wrap)
      • gethA1PrefixLength

        private int gethA1PrefixLength​(String cipher)