Package tigase.auth.mechanisms
Class AbstractSaslSCRAM
java.lang.Object
tigase.auth.mechanisms.AbstractSasl
tigase.auth.mechanisms.AbstractSaslSCRAM
- All Implemented Interfaces:
SaslServer
- Direct Known Subclasses:
SaslSCRAM,SaslSCRAMPlus,SaslSCRAMSha256,SaslSCRAMSha256Plus,SaslSCRAMSha512,SaslSCRAMSha512Plus
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class tigase.auth.mechanisms.AbstractSasl
authorizedId, callbackHandler, complete, log, negotiatedProperty, PASSWORD_NOT_VERIFIED_MSG, props, SASL_STRICT_MODE_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String, ?> props, CallbackHandler callbackHandler) protectedAbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String, ?> props, CallbackHandler callbackHandler, String serverOnce) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]protected abstract voidcheckRequestedBindType(AbstractSaslSCRAM.BindType requestedBindType) byte[]evaluateResponse(byte[] response) static Elementprotected byte[]h(byte[] data) static byte[]static byte[]static byte[]protected static byte[]protected SecretKeykey(byte[] key) static byte[]protected byte[]processClientFirstMessage(byte[] data) protected byte[]processClientLastMessage(byte[] data) byte[]unwrap(byte[] incoming, int offset, int len) protected voidvalidateBindingsData(AbstractSaslSCRAM.BindType requestedBindType, byte[] bindingData) byte[]wrap(byte[] outgoing, int offset, int len) protected byte[]xor(byte[] a, byte[] b) Methods inherited from class tigase.auth.mechanisms.AbstractSasl
dispose, getNegotiatedProperty, handleCallbacks, isAuthzIDIgnored, isComplete, isEmpty, split
-
Field Details
-
TLS_UNIQUE_ID_KEY
- See Also:
-
TLS_EXPORTER_KEY
- See Also:
-
LOCAL_CERTIFICATE_KEY
- See Also:
-
-
Constructor Details
-
AbstractSaslSCRAM
protected AbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String, ?> props, CallbackHandler callbackHandler) -
AbstractSaslSCRAM
-
-
Method Details
-
getSupportedChannelBindings
-
h
- Throws:
NoSuchAlgorithmException
-
hi
public static byte[] hi(String algorithm, byte[] password, byte[] salt, int iterations) throws InvalidKeyException, NoSuchAlgorithmException -
hmac
protected static byte[] hmac(SecretKey key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException -
hmac
public static byte[] hmac(String algorithm, byte[] key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException -
normalize
-
evaluateResponse
- Throws:
SaslException
-
getAuthorizationID
-
getMechanismName
-
unwrap
public byte[] unwrap(byte[] incoming, int offset, int len) -
wrap
public byte[] wrap(byte[] outgoing, int offset, int len) -
calculateC
protected byte[] calculateC() -
checkRequestedBindType
protected abstract void checkRequestedBindType(AbstractSaslSCRAM.BindType requestedBindType) throws SaslException - Throws:
SaslException
-
h
- Throws:
NoSuchAlgorithmException
-
key
-
processClientFirstMessage
- Throws:
SaslException
-
processClientLastMessage
protected byte[] processClientLastMessage(byte[] data) throws SaslException, InvalidKeyException, NoSuchAlgorithmException -
validateBindingsData
protected void validateBindingsData(AbstractSaslSCRAM.BindType requestedBindType, byte[] bindingData) -
xor
protected byte[] xor(byte[] a, byte[] b)
-