default OneTimePasswordAlgorithmSpec getParameterSpec() { return new OneTimePasswordAlgorithmSpec(getAlgorithm(), getSeed(), getSequenceNumber()); }
OneTimePasswordImpl(final OneTimePassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSeed(), password.getSequenceNumber()); }
final OneTimePassword otp = (OneTimePassword) password; streamWriter.writeStartElement("otp"); streamWriter.writeAttribute("algorithm", otp.getAlgorithm()); streamWriter.writeAttribute("hash", ByteIterator.ofBytes(otp.getHash()).base64Encode().drainToString()); streamWriter.writeAttribute("seed", ByteIterator.ofBytes(otp.getSeed().getBytes(StandardCharsets.US_ASCII)).base64Encode().drainToString());
@Override public void persistCredential(final Credential credential) throws RealmUnavailableException { OneTimePassword password = credential.castAndApply(PasswordCredential.class, c -> c.getPassword(OneTimePassword.class)); try { Attributes attributes = new BasicAttributes(); attributes.put(algorithmAttributeName, password.getAlgorithm()); attributes.put(hashAttributeName, ByteIterator.ofBytes(password.getHash()).base64Encode().drainToString()); attributes.put(seedAttributeName, password.getSeed()); attributes.put(sequenceAttributeName, Integer.toString(password.getSequenceNumber())); context.modifyAttributes(distinguishedName, DirContext.REPLACE_ATTRIBUTE, attributes); } catch (NamingException e) { throw log.ldapRealmCredentialPersistingFailed(credential.toString(), distinguishedName, e); } }
throw saslOTP.mechUnableToRetrievePassword(userName).toSaslException(); previousAlgorithm = previousPassword.getAlgorithm(); validateAlgorithm(previousAlgorithm); previousSeed = previousPassword.getSeed();
default OneTimePasswordAlgorithmSpec getParameterSpec() { return new OneTimePasswordAlgorithmSpec(getAlgorithm(), getSeed(), getSequenceNumber()); }
default OneTimePasswordAlgorithmSpec getParameterSpec() { return new OneTimePasswordAlgorithmSpec(getAlgorithm(), getSeed(), getSequenceNumber()); }
default OneTimePasswordAlgorithmSpec getParameterSpec() { return new OneTimePasswordAlgorithmSpec(getAlgorithm(), getSeed(), getSequenceNumber()); }
OneTimePasswordImpl(final OneTimePassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSeed(), password.getSequenceNumber()); }
OneTimePasswordImpl(final OneTimePassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSeed(), password.getSequenceNumber()); }
final OneTimePassword otp = (OneTimePassword) password; streamWriter.writeStartElement("otp"); streamWriter.writeAttribute("algorithm", otp.getAlgorithm()); streamWriter.writeAttribute("hash", ByteIterator.ofBytes(otp.getHash()).base64Encode().drainToString()); streamWriter.writeAttribute("seed", ByteIterator.ofBytes(otp.getSeed().getBytes(StandardCharsets.US_ASCII)).base64Encode().drainToString());
final OneTimePassword otp = (OneTimePassword) password; streamWriter.writeStartElement("otp"); streamWriter.writeAttribute("algorithm", otp.getAlgorithm()); streamWriter.writeAttribute("hash", ByteIterator.ofBytes(otp.getHash()).base64Encode().drainToString()); streamWriter.writeAttribute("seed", ByteIterator.ofBytes(otp.getSeed().getBytes(StandardCharsets.US_ASCII)).base64Encode().drainToString());
final OneTimePassword otp = (OneTimePassword) password; streamWriter.writeStartElement("otp"); streamWriter.writeAttribute("algorithm", otp.getAlgorithm()); streamWriter.writeAttribute("hash", ByteIterator.ofBytes(otp.getHash()).base64Encode().drainToString()); streamWriter.writeAttribute("seed", ByteIterator.ofBytes(otp.getSeed().getBytes(StandardCharsets.US_ASCII)).base64Encode().drainToString());
OneTimePasswordImpl(final OneTimePassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSeed(), password.getSequenceNumber()); }
@Override public void persistCredential(final Credential credential) throws RealmUnavailableException { OneTimePassword password = credential.castAndApply(PasswordCredential.class, c -> c.getPassword(OneTimePassword.class)); try { Attributes attributes = new BasicAttributes(); attributes.put(algorithmAttributeName, password.getAlgorithm()); attributes.put(hashAttributeName, ByteIterator.ofBytes(password.getHash()).base64Encode().drainToString()); attributes.put(seedAttributeName, password.getSeed()); attributes.put(sequenceAttributeName, Integer.toString(password.getSequenceNumber())); context.modifyAttributes(distinguishedName, DirContext.REPLACE_ATTRIBUTE, attributes); } catch (NamingException e) { throw log.ldapRealmCredentialPersistingFailed(credential.toString(), distinguishedName, e); } }
@Override public void persistCredential(final Credential credential) throws RealmUnavailableException { OneTimePassword password = credential.castAndApply(PasswordCredential.class, c -> c.getPassword(OneTimePassword.class)); try { Attributes attributes = new BasicAttributes(); attributes.put(algorithmAttributeName, password.getAlgorithm()); attributes.put(hashAttributeName, ByteIterator.ofBytes(password.getHash()).base64Encode().drainToString()); attributes.put(seedAttributeName, password.getSeed()); attributes.put(sequenceAttributeName, Integer.toString(password.getSequenceNumber())); context.modifyAttributes(distinguishedName, DirContext.REPLACE_ATTRIBUTE, attributes); } catch (NamingException e) { throw log.ldapRealmCredentialPersistingFailed(credential.toString(), distinguishedName, e); } }
@Override public void persistCredential(final Credential credential) throws RealmUnavailableException { OneTimePassword password = credential.castAndApply(PasswordCredential.class, c -> c.getPassword(OneTimePassword.class)); try { Attributes attributes = new BasicAttributes(); attributes.put(algorithmAttributeName, password.getAlgorithm()); attributes.put(hashAttributeName, ByteIterator.ofBytes(password.getHash()).base64Encode().drainToString()); attributes.put(seedAttributeName, password.getSeed()); attributes.put(sequenceAttributeName, Integer.toString(password.getSequenceNumber())); context.modifyAttributes(distinguishedName, DirContext.REPLACE_ATTRIBUTE, attributes); } catch (NamingException e) { throw log.ldapRealmCredentialPersistingFailed(credential.toString(), distinguishedName, e); } }
throw saslOTP.mechUnableToRetrievePassword(userName).toSaslException(); previousAlgorithm = previousPassword.getAlgorithm(); validateAlgorithm(previousAlgorithm); previousSeed = previousPassword.getSeed();
throw saslOTP.mechUnableToRetrievePassword(userName).toSaslException(); previousAlgorithm = previousPassword.getAlgorithm(); validateAlgorithm(previousAlgorithm); previousSeed = previousPassword.getSeed();
throw saslOTP.mechUnableToRetrievePassword(userName).toSaslException(); previousAlgorithm = previousPassword.getAlgorithm(); validateAlgorithm(previousAlgorithm); previousSeed = previousPassword.getSeed();