ScramDigestPasswordImpl(final ScramDigestPassword password) { this(password.getAlgorithm(), password.getDigest().clone(), password.getSalt().clone(), password.getIterationCount()); }
Object writeReplace() { return ScramDigestPassword.createRaw(algorithm, digest, salt, iterationCount); }
default IteratedSaltedPasswordAlgorithmSpec getParameterSpec() { return new IteratedSaltedPasswordAlgorithmSpec(getIterationCount(), getSalt()); }
final ScramDigestPassword password = MechanismUtil.getPasswordCredential(clientMessage.getAuthenticationName(), callbackHandler, ScramDigestPassword.class, mechanism.getPasswordAlgorithm(), null, generateParameters, providers, saslScram); final byte[] saltedPasswordBytes = password.getDigest(); final int iterationCount = password.getIterationCount(); if (iterationCount < minimumIterationCount) { throw saslScram.mechIterationCountIsTooLow(iterationCount, minimumIterationCount); throw saslScram.mechIterationCountIsTooHigh(iterationCount, maximumIterationCount); final byte[] salt = password.getSalt();
mac.init(new SecretKeySpec(password.getDigest(), mac.getAlgorithm())); byte[] serverKey = mac.doFinal(ScramUtil.SERVER_KEY_BYTES); if(trace) saslScram.tracef("[C] Server key: %s%n", ByteIterator.ofBytes(serverKey).hexEncode().drainToString());
final ScramDigestPassword password = MechanismUtil.getPasswordCredential(clientMessage.getAuthenticationName(), callbackHandler, ScramDigestPassword.class, mechanism.getPasswordAlgorithm(), null, generateParameters, providers, saslScram); final byte[] saltedPasswordBytes = password.getDigest(); final int iterationCount = password.getIterationCount(); if (iterationCount < minimumIterationCount) { throw saslScram.mechIterationCountIsTooLow(iterationCount, minimumIterationCount); throw saslScram.mechIterationCountIsTooHigh(iterationCount, maximumIterationCount); final byte[] salt = password.getSalt();
default boolean impliesParameters(AlgorithmParameterSpec parameterSpec) { Assert.checkNotNullParam("parameterSpec", parameterSpec); if (parameterSpec instanceof IteratedSaltedPasswordAlgorithmSpec) { final IteratedSaltedPasswordAlgorithmSpec spec = (IteratedSaltedPasswordAlgorithmSpec) parameterSpec; return getIterationCount() <= spec.getIterationCount() && Arrays.equals(getSalt(), spec.getSalt()); } else if (parameterSpec instanceof SaltedPasswordAlgorithmSpec) { return Arrays.equals(getSalt(), ((SaltedPasswordAlgorithmSpec) parameterSpec).getSalt()); } else if (parameterSpec instanceof IteratedPasswordAlgorithmSpec) { return getIterationCount() <= ((IteratedPasswordAlgorithmSpec) parameterSpec).getIterationCount(); } else { return false; } }
byte[] saltedPassword = initialResult.getScramDigestPassword().getDigest(); mac.init(new SecretKeySpec(saltedPassword, mac.getAlgorithm())); mac.update(ScramUtil.CLIENT_KEY_BYTES);
ScramDigestPasswordImpl(final ScramDigestPassword password) { this(password.getAlgorithm(), password.getDigest().clone(), password.getSalt().clone(), password.getIterationCount()); }
final ScramDigestPassword password = MechanismUtil.getPasswordCredential(clientMessage.getAuthenticationName(), callbackHandler, ScramDigestPassword.class, mechanism.getPasswordAlgorithm(), null, generateParameters, providers, saslScram); final byte[] saltedPasswordBytes = password.getDigest(); final int iterationCount = password.getIterationCount(); if (iterationCount < minimumIterationCount) { throw saslScram.mechIterationCountIsTooLow(iterationCount, minimumIterationCount); throw saslScram.mechIterationCountIsTooHigh(iterationCount, maximumIterationCount); final byte[] salt = password.getSalt();
default IteratedSaltedPasswordAlgorithmSpec getParameterSpec() { return new IteratedSaltedPasswordAlgorithmSpec(getIterationCount(), getSalt()); }
providers, saslScram); final byte[] saltedPassword = password.getDigest(); if (trace) saslScram.tracef("[C] Client salted password: %s", ByteIterator.ofBytes(saltedPassword).hexEncode().drainToString());
Object writeReplace() { return ScramDigestPassword.createRaw(algorithm, digest, salt, iterationCount); }
ScramDigestPasswordImpl(final ScramDigestPassword password) { this(password.getAlgorithm(), password.getDigest().clone(), password.getSalt().clone(), password.getIterationCount()); }
final ScramDigestPassword password = MechanismUtil.getPasswordCredential(clientMessage.getAuthenticationName(), callbackHandler, ScramDigestPassword.class, mechanism.getPasswordAlgorithm(), null, generateParameters, providers, saslScram); final byte[] saltedPasswordBytes = password.getDigest(); final int iterationCount = password.getIterationCount(); if (iterationCount < minimumIterationCount) { throw saslScram.mechIterationCountIsTooLow(iterationCount, minimumIterationCount); throw saslScram.mechIterationCountIsTooHigh(iterationCount, maximumIterationCount); final byte[] salt = password.getSalt();
default IteratedSaltedPasswordAlgorithmSpec getParameterSpec() { return new IteratedSaltedPasswordAlgorithmSpec(getIterationCount(), getSalt()); }
mac.init(new SecretKeySpec(password.getDigest(), mac.getAlgorithm())); byte[] serverKey = mac.doFinal(ScramUtil.SERVER_KEY_BYTES); if(trace) saslScram.tracef("[C] Server key: %s%n", ByteIterator.ofBytes(serverKey).hexEncode().drainToString());
Object writeReplace() { return ScramDigestPassword.createRaw(algorithm, digest, salt, iterationCount); }
ScramDigestPasswordImpl(final ScramDigestPassword password) { this(password.getAlgorithm(), password.getDigest().clone(), password.getSalt().clone(), password.getIterationCount()); }
default IteratedSaltedPasswordAlgorithmSpec getParameterSpec() { return new IteratedSaltedPasswordAlgorithmSpec(getIterationCount(), getSalt()); }