| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | DigestMD5Base.
Implementation of the SecurityCtx interface allowing for messages between the client and server to be integrity checked. |
| pack-priv class | DigestMD5Base.
Implementation of the SecurityCtx interface allowing for messages between the client and server to be integrity checked and encrypted. |
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected CallbackHandler | |
| protected static final byte[] | |
| protected static final String[] | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final byte | |
| protected static final byte | |
| private static final String | |
| protected String | |
| private static final String | |
| protected static final byte[] | |
| private static final int | |
| protected Charset | |
| protected byte[] | |
| private static final String[] | |
| private static final BigInteger | |
| protected static final int | |
| protected static final int | |
| protected String | |
| protected String | |
| protected String | |
| protected String | |
| protected byte[] | |
| private static final char[] | pem_array
This array maps the characters to their 6 bit values |
| private static final int | |
| protected static final int | |
| protected static final int | |
| protected static final byte | |
| protected static final int | |
| protected static final byte | |
| protected static final byte | |
| protected SecurityCtx | |
| private static final SecureRandom | |
| private static final String | |
| protected int | |
| protected static final byte | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| protected | DigestMD5Base(Map<String, ?>
A map of property/value pairs props, String name of class to use for logging className, int number of first step in authentication state machine firstStep, String digestUri used in authentication digestUri, CallbackHandler callback handler used to get info required for auth cbh)Constructs an instance of DigestMD5Base. |
| Modifier and Type | Method and Description |
|---|---|
| private static byte[] | addDesParity(byte[] input, int offset, int len)
Expands a 7-byte array into an 8-byte array that contains parity bits The binary format of a cryptographic key is: (B1,B2,...,B7,P1,B8,...B14,P2,B15,...,B49,P7,B50,...,B56,P8) where (B1,B2,...,B56) are the independent bits of a DES key and (PI,P2,...,P8) are reserved for parity bits computed on the preceding seven independent bits and set so that the parity of the octet is odd, i.e., there is an odd number of "1" bits in the octet. |
| protected byte[] | Returns: a non-null String contain the HEX valueConvert a byte array to hexadecimal string. |
| public void | |
| private static void | extractDirective(String
A non-null String challenge token name. key, byte[] A non-null String token value. value, String[] keyTable, byte[][] valueTable, List<byte[]> realmChoices, int realmIndex)Processes directive/value pairs from the digest-challenge and fill out the challengeVal array. |
| protected static final byte[] | |
| protected byte[] | Returns: A non-null byte array containing the repsonse-value."AUTHENTICATE" for client-generated response;
"" for server-generated response authMethod, String digestUriValue, String qopValue, String usernameValue, String realmValue, char[] passwdValue, byte[] nonceValue, byte[] cNonceValue, int nonceCount, byte[] authzidValue)Assembles response-value for digest-response. |
| public String | |
| public Object | getNegotiatedProperty(String propName)
Overrides com. Retrieves the negotiated property. |
| protected static byte[] | |
| private static boolean | |
| private static SecretKey | Returns: SecretKey An instance of either DESKeySpec or DESedeKeySpec.A non-null byte array containing key material for
DES / DESede. input, String A string specifying eithe a DES or a DESede key. desStrength)Create parity-adjusted keys suitable for DES / DESede encryption. |
| private static boolean | |
| private static boolean | |
| protected static String | Returns: A non-null String representing the current NONCE-COUNTTakes 'nonceCount' value and returns HEX value of the value. |
| protected static byte[][] | parseDirectives(byte[]
A non-null digest-challenge string. buf, String[] keyTable, List<byte[]> realmChoices, int realmIndex)Parses digest-challenge string, extracting each token and value(s) |
| protected static String | |
| private static void | setParityBit(byte[] key)
Sets the parity bit (0th bit) in each byte so that each byte contains an odd number of 1's. |
| private static int | |
| protected byte[] | Returns: a non-null byte array containing the correct character encoding for username, paswd or realm.Used to convert username-value, passwd or realm to 8859_1 encoding if all chars in string are within the 8859_1 (Latin 1) encoding range. |
| public byte[] | Returns: The unwrapped message according to either the integrity or privacy quality-of-protection specifications.The byte array containing the incoming bytes. incoming, int The offset from which to read the byte array. start, int The number of bytes to read from the offset. len)Unwrap the incoming message using the wrap method of the secCtx object instance. |
| public byte[] | Returns: The wrapped message according to either the integrity or privacy quality-of-protection specifications.The byte array containing the outgoing bytes. outgoing, int The offset from which to read the byte array. start, int The number of bytes to read from the offset. len)Wrap outgoing bytes using the wrap method of the secCtx object instance. |
| protected static void | writeQuotedStringValue(ByteArrayOutputStream out, byte[] buf)
Checks if a byte[] contains characters that must be quoted and write the resulting, possibly escaped, characters to out. |
| authzid | back to summary |
|---|---|
| protected String authzid | |
| cbh | back to summary |
|---|---|
| protected CallbackHandler cbh | |
| CIPHER_MASKS | back to summary |
|---|---|
| protected static final byte[] CIPHER_MASKS | |
| CIPHER_TOKENS | back to summary |
|---|---|
| protected static final String[] CIPHER_TOKENS | |
| DEFAULT_MAXBUF | back to summary |
|---|---|
| protected static final int DEFAULT_MAXBUF | |
| DES | back to summary |
|---|---|
| protected static final int DES | |
| DES3 | back to summary |
|---|---|
| protected static final int DES3 | |
| DES_3_STRENGTH | back to summary |
|---|---|
| protected static final byte DES_3_STRENGTH | |
| DES_STRENGTH | back to summary |
|---|---|
| protected static final byte DES_STRENGTH | |
| DI_CLASS_NAME | back to summary |
|---|---|
| private static final String DI_CLASS_NAME | |
| digestUri | back to summary |
|---|---|
| protected String digestUri | |
| DP_CLASS_NAME | back to summary |
|---|---|
| private static final String DP_CLASS_NAME | |
| EMPTY_BYTE_ARRAY | back to summary |
|---|---|
| protected static final byte[] EMPTY_BYTE_ARRAY | |
| ENCODED_NONCE_SIZE | back to summary |
|---|---|
| private static final int ENCODED_NONCE_SIZE | |
| encoding | back to summary |
|---|---|
| protected Charset encoding | |
| H_A1 | back to summary |
|---|---|
| protected byte[] H_A1 | |
| JCE_CIPHER_NAME | back to summary |
|---|---|
| private static final String[] JCE_CIPHER_NAME | |
| MASK | back to summary |
|---|---|
| private static final BigInteger MASK | |
| MAX_CHALLENGE_LENGTH | back to summary |
|---|---|
| protected static final int MAX_CHALLENGE_LENGTH | |
| MAX_RESPONSE_LENGTH | back to summary |
|---|---|
| protected static final int MAX_RESPONSE_LENGTH | |
| negotiatedCipher | back to summary |
|---|---|
| protected String negotiatedCipher | |
| negotiatedQop | back to summary |
|---|---|
| protected String negotiatedQop | |
| negotiatedRealm | back to summary |
|---|---|
| protected String negotiatedRealm | |
| negotiatedStrength | back to summary |
|---|---|
| protected String negotiatedStrength | |
| nonce | back to summary |
|---|---|
| protected byte[] nonce | |
| pem_array | back to summary |
|---|---|
| private static final char[] pem_array This array maps the characters to their 6 bit values | |
| RAW_NONCE_SIZE | back to summary |
|---|---|
| private static final int RAW_NONCE_SIZE | |
| RC4 | back to summary |
|---|---|
| protected static final int RC4 | |
| RC4_40 | back to summary |
|---|---|
| protected static final int RC4_40 | |
| RC4_40_STRENGTH | back to summary |
|---|---|
| protected static final byte RC4_40_STRENGTH | |
| RC4_56 | back to summary |
|---|---|
| protected static final int RC4_56 | |
| RC4_56_STRENGTH | back to summary |
|---|---|
| protected static final byte RC4_56_STRENGTH | |
| RC4_STRENGTH | back to summary |
|---|---|
| protected static final byte RC4_STRENGTH | |
| secCtx | back to summary |
|---|---|
| protected SecurityCtx secCtx | |
| SECURE_RANDOM | back to summary |
|---|---|
| private static final SecureRandom SECURE_RANDOM | |
| SECURITY_LAYER_MARKER | back to summary |
|---|---|
| private static final String SECURITY_LAYER_MARKER | |
| step | back to summary |
|---|---|
| protected int step | |
| UNSET | back to summary |
|---|---|
| protected static final byte UNSET | |
| useUTF8 | back to summary |
|---|---|
| protected boolean useUTF8 | |
| DigestMD5Base | back to summary |
|---|---|
| protected DigestMD5Base(Map<String, ?> props, String className, int firstStep, String digestUri, CallbackHandler cbh) throws SaslException Constructs an instance of DigestMD5Base. Calls super constructor to parse properties for mechanism.
| |
| addDesParity | back to summary |
|---|---|
| private static byte[] addDesParity(byte[] input, int offset, int len) Expands a 7-byte array into an 8-byte array that contains parity bits The binary format of a cryptographic key is: (B1,B2,...,B7,P1,B8,...B14,P2,B15,...,B49,P7,B50,...,B56,P8) where (B1,B2,...,B56) are the independent bits of a DES key and (PI,P2,...,P8) are reserved for parity bits computed on the preceding seven independent bits and set so that the parity of the octet is odd, i.e., there is an odd number of "1" bits in the octet. | |
| binaryToHex | back to summary |
|---|---|
| protected byte[] binaryToHex(byte[] digest) Convert a byte array to hexadecimal string.
| |
| dispose | back to summary |
|---|---|
| public void dispose() throws SaslException | |
| extractDirective | back to summary |
|---|---|
| private static void extractDirective(String key, byte[] value, String[] keyTable, byte[][] valueTable, List<byte[]> realmChoices, int realmIndex) throws SaslException Processes directive/value pairs from the digest-challenge and fill out the challengeVal array.
| |
| generateNonce | back to summary |
|---|---|
| protected static final byte[] generateNonce() | |
| generateResponseValue | back to summary |
|---|---|
| protected byte[] generateResponseValue(String authMethod, String digestUriValue, String qopValue, String usernameValue, String realmValue, char[] passwdValue, byte[] nonceValue, byte[] cNonceValue, int nonceCount, byte[] authzidValue) throws NoSuchAlgorithmException, IOException Assembles response-value for digest-response.
| |
| getMechanismName | back to summary |
|---|---|
| public String getMechanismName() Retrieves the SASL mechanism IANA name.
| |
| getNegotiatedProperty | back to summary |
|---|---|
| public Object getNegotiatedProperty(String propName) Overrides com. Doc from com. Retrieves the negotiated property. | |
| getPlatformCiphers | back to summary |
|---|---|
| protected static byte[] getPlatformCiphers() | |
| isLws | back to summary |
|---|---|
| private static boolean isLws(byte b) | |
| makeDesKeys | back to summary |
|---|---|
| private static SecretKey makeDesKeys(byte[] input, String desStrength) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException Create parity-adjusted keys suitable for DES / DESede encryption.
| |
| needEscape | back to summary |
|---|---|
| private static boolean needEscape(String str) | |
| needEscape | back to summary |
|---|---|
| private static boolean needEscape(char ch) | |
| nonceCountToHex | back to summary |
|---|---|
| protected static String nonceCountToHex(int count) Takes 'nonceCount' value and returns HEX value of the value.
| |
| parseDirectives | back to summary |
|---|---|
| protected static byte[][] parseDirectives(byte[] buf, String[] keyTable, List<byte[]> realmChoices, int realmIndex) throws SaslException Parses digest-challenge string, extracting each token and value(s)
| |
| quotedStringValue | back to summary |
|---|---|
| protected static String quotedStringValue(String str) | |
| setParityBit | back to summary |
|---|---|
| private static void setParityBit(byte[] key) Sets the parity bit (0th bit) in each byte so that each byte contains an odd number of 1's. | |
| skipLws | back to summary |
|---|---|
| private static int skipLws(byte[] buf, int start) | |
| stringToByte_8859_1 | back to summary |
|---|---|
| protected byte[] stringToByte_8859_1(String str) Used to convert username-value, passwd or realm to 8859_1 encoding if all chars in string are within the 8859_1 (Latin 1) encoding range.
| |
| unwrap | back to summary |
|---|---|
| public byte[] unwrap(byte[] incoming, int start, int len) throws SaslException Unwrap the incoming message using the wrap method of the secCtx object instance.
| |
| wrap | back to summary |
|---|---|
| public byte[] wrap(byte[] outgoing, int start, int len) throws SaslException Wrap outgoing bytes using the wrap method of the secCtx object instance.
| |
| writeQuotedStringValue | back to summary |
|---|---|
| protected static void writeQuotedStringValue(ByteArrayOutputStream out, byte[] buf) Checks if a byte[] contains characters that must be quoted and write the resulting, possibly escaped, characters to out. | |
Further details on the integrity-protection mechanism can be found at section 2.3 - Integrity protection in the RFC2831 definition.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| protected final byte[] | |
| protected byte[] | |
| protected int | |
| protected byte[] | |
| protected int | |
| protected final byte[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | DigestIntegrity(boolean clientMode)
Initializes DigestIntegrity implementation of SecurityCtx to enable DIGEST-MD5 integrity checking. |
| Modifier and Type | Method and Description |
|---|---|
| private void | generateIntegrityKeyPair(boolean clientMode)
Generate client-server, server-client key pairs for DIGEST-MD5 integrity checking. |
| protected byte[] | Returns: The MAC of a message.A non-null byte array containing the key for the digest Ki, byte[] seqnum, byte[] The message to be digested msg, int The offset from which to read the msg byte array start, int The non-zero number of bytes to be read from the offset len)Generates MAC to be appended onto out-going messages. |
| protected void | |
| public byte[] | Returns: The verified message or null if integrity checking fails.A non-null byte array containing the incoming
message. incoming, int The offset from which to read the byte array. start, int The non-zero number of bytes to read from the offset
position. len)Implements com. Return verified message without MAC - only if the received MAC and re-generated MAC are the same. |
| public byte[] | Returns: The message including the integrity MACA non-null byte array containing the outgoing message. outgoing, int The offset from which to read the byte array. start, int The non-zero number of bytes for be read from the offset. len)Implements com. Append MAC onto outgoing message. |
| CLIENT_INT_MAGIC | back to summary |
|---|---|
| private static final String CLIENT_INT_MAGIC | |
| messageType | back to summary |
|---|---|
| protected final byte[] messageType | |
| myKi | back to summary |
|---|---|
| protected byte[] myKi | |
| mySeqNum | back to summary |
|---|---|
| protected int mySeqNum | |
| peerKi | back to summary |
|---|---|
| protected byte[] peerKi | |
| peerSeqNum | back to summary |
|---|---|
| protected int peerSeqNum | |
| sequenceNum | back to summary |
|---|---|
| protected final byte[] sequenceNum | |
| SVR_INT_MAGIC | back to summary |
|---|---|
| private static final String SVR_INT_MAGIC | |
| DigestIntegrity | back to summary |
|---|---|
| pack-priv DigestIntegrity(boolean clientMode) throws SaslException Initializes DigestIntegrity implementation of SecurityCtx to enable DIGEST-MD5 integrity checking.
| |
| generateIntegrityKeyPair | back to summary |
|---|---|
| private void generateIntegrityKeyPair(boolean clientMode) throws IOException, NoSuchAlgorithmException Generate client-server, server-client key pairs for DIGEST-MD5 integrity checking.
| |
| getHMAC | back to summary |
|---|---|
| protected byte[] getHMAC(byte[] Ki, byte[] seqnum, byte[] msg, int start, int len) throws SaslException Generates MAC to be appended onto out-going messages.
| |
| incrementSeqNum | back to summary |
|---|---|
| protected void incrementSeqNum() Increment own sequence number and set answer in NBO sequenceNum field. | |
| unwrap | back to summary |
|---|---|
| public byte[] unwrap(byte[] incoming, int start, int len) throws SaslException Implements com. Return verified message without MAC - only if the received MAC and re-generated MAC are the same.
| |
| wrap | back to summary |
|---|---|
| public byte[] wrap(byte[] outgoing, int start, int len) throws SaslException Implements com. Append MAC onto outgoing message.
| |
Further details on the integrity-protection mechanism can be found at section 2.4 - Confidentiality protection in RFC2831 definition.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private Cipher | |
| private Cipher | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | DigestPrivacy(boolean clientMode)
Initializes the cipher object instances for encryption and decryption. |
| Modifier and Type | Method and Description |
|---|---|
| private void | generatePrivacyKeyPair(boolean clientMode)
Generates client-server and server-client keys to encrypt and decrypt messages. |
| public byte[] | unwrap(byte[] incoming, int start, int len)
Overrides com. Implements com. Unwrap incoming message and return original message |
| public byte[] | Returns: The encrypted message.A non-null byte array containing the outgoing message. outgoing, int The offset from which to read the byte array. start, int The non-zero number of bytes to be read from the offset. len)Overrides com. Implements com. Encrypt out-going message. |
| CLIENT_CONF_MAGIC | back to summary |
|---|---|
| private static final String CLIENT_CONF_MAGIC | |
| decCipher | back to summary |
|---|---|
| private Cipher decCipher | |
| encCipher | back to summary |
|---|---|
| private Cipher encCipher | |
| SVR_CONF_MAGIC | back to summary |
|---|---|
| private static final String SVR_CONF_MAGIC | |
| DigestPrivacy | back to summary |
|---|---|
| pack-priv DigestPrivacy(boolean clientMode) throws SaslException Initializes the cipher object instances for encryption and decryption.
| |
| generatePrivacyKeyPair | back to summary |
|---|---|
| private void generatePrivacyKeyPair(boolean clientMode) throws IOException, NoSuchAlgorithmException, SaslException Generates client-server and server-client keys to encrypt and decrypt messages. Also generates IVs for DES ciphers.
| |
| unwrap | back to summary |
|---|---|
| public byte[] unwrap(byte[] incoming, int start, int len) throws SaslException Overrides com. Implements com. Doc from com. Unwrap incoming message and return original message
| |
| wrap | back to summary |
|---|---|
| public byte[] wrap(byte[] outgoing, int start, int len) throws SaslException Overrides com. Implements com. Encrypt out-going message.
| |