logo
down
shadow

How to specify hash algorithm when updating LDAP via Java?


How to specify hash algorithm when updating LDAP via Java?

By : Big LUUIE
Date : January 10 2021, 01:57 PM
Hope that helps Is there a way to specify the hash algorithm (MD5, SHA1, etc.) to use for storing the passwords when you update an Open LDAP directory using Java APIs with code like this: , Something along these lines should do it: (MD5) Shown
code :


Share : facebook icon twitter icon
What hash algorithm does .net utilise? What about java?

What hash algorithm does .net utilise? What about java?


By : Jeff Crow
Date : March 29 2020, 07:55 AM
may help you . The hash function is not built into the hash table; the hash table invokes a method on the key object to compute the hash. So, the hash function varies depending on the type of key object.
In Java, a List is not a hash table (that is, it doesn't extend the Map interface). One could implement a List with a hash table internally (a sparse list, where the list index is the key into the hash table), but such an implementation is not part of the standard Java library.
How to get the hash algorithm name using the OID in Java?

How to get the hash algorithm name using the OID in Java?


By : Rajesh
Date : March 29 2020, 07:55 AM
it helps some times I found an answer. The class org.bouncycastle.cms.CMSSignedHelper from Bouncy Castle Library has the mapping. I extracted the required snippet from there and copied here.
code :
...
private static final Map     encryptionAlgs = new HashMap();
private static final Map     digestAlgs = new HashMap();

static
{
    encryptionAlgs.put(X9ObjectIdentifiers.id_dsa_with_sha1.getId(), "DSA");
    encryptionAlgs.put(X9ObjectIdentifiers.id_dsa.getId(), "DSA");
    encryptionAlgs.put(OIWObjectIdentifiers.dsaWithSHA1.getId(), "DSA");
    encryptionAlgs.put(PKCSObjectIdentifiers.rsaEncryption.getId(), "RSA");
    encryptionAlgs.put(PKCSObjectIdentifiers.sha1WithRSAEncryption.getId(), "RSA");
    encryptionAlgs.put(TeleTrusTObjectIdentifiers.teleTrusTRSAsignatureAlgorithm, "RSA");
    encryptionAlgs.put(X509ObjectIdentifiers.id_ea_rsa.getId(), "RSA");
    encryptionAlgs.put(CMSSignedDataGenerator.ENCRYPTION_ECDSA, "ECDSA");
    encryptionAlgs.put(X9ObjectIdentifiers.ecdsa_with_SHA2.getId(), "ECDSA");
    encryptionAlgs.put(X9ObjectIdentifiers.ecdsa_with_SHA224.getId(), "ECDSA");
    encryptionAlgs.put(X9ObjectIdentifiers.ecdsa_with_SHA256.getId(), "ECDSA");
    encryptionAlgs.put(X9ObjectIdentifiers.ecdsa_with_SHA384.getId(), "ECDSA");
    encryptionAlgs.put(X9ObjectIdentifiers.ecdsa_with_SHA512.getId(), "ECDSA");
    encryptionAlgs.put(CMSSignedDataGenerator.ENCRYPTION_RSA_PSS, "RSAandMGF1");
    encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_94.getId(), "GOST3410");
    encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_2001.getId(), "ECGOST3410");
    encryptionAlgs.put("1.3.6.1.4.1.5849.1.6.2", "ECGOST3410");
    encryptionAlgs.put("1.3.6.1.4.1.5849.1.1.5", "GOST3410");

    digestAlgs.put(PKCSObjectIdentifiers.md5.getId(), "MD5");
    digestAlgs.put(OIWObjectIdentifiers.idSHA1.getId(), "SHA1");
    digestAlgs.put(NISTObjectIdentifiers.id_sha224.getId(), "SHA224");
    digestAlgs.put(NISTObjectIdentifiers.id_sha256.getId(), "SHA256");
    digestAlgs.put(NISTObjectIdentifiers.id_sha384.getId(), "SHA384");
    digestAlgs.put(NISTObjectIdentifiers.id_sha512.getId(), "SHA512");
    digestAlgs.put(PKCSObjectIdentifiers.sha1WithRSAEncryption.getId(), "SHA1");
    digestAlgs.put(PKCSObjectIdentifiers.sha224WithRSAEncryption.getId(), "SHA224");
    digestAlgs.put(PKCSObjectIdentifiers.sha256WithRSAEncryption.getId(), "SHA256");
    digestAlgs.put(PKCSObjectIdentifiers.sha384WithRSAEncryption.getId(), "SHA384");
    digestAlgs.put(PKCSObjectIdentifiers.sha512WithRSAEncryption.getId(), "SHA512");
    digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd128.getId(), "RIPEMD128");
    digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd160.getId(), "RIPEMD160");
    digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd256.getId(), "RIPEMD256");
    digestAlgs.put(CryptoProObjectIdentifiers.gostR3411.getId(),  "GOST3411");
    digestAlgs.put("1.3.6.1.4.1.5849.1.2.1",  "GOST3411");
}

String getDigestAlgName(String digestAlgOID) {
    String algName = (String)digestAlgs.get(digestAlgOID);

    if (algName != null)
    {
        return algName;
    }

    return digestAlgOID;
}

String getEncryptionAlgName(String encryptionAlgOID) {
    String algName = (String)encryptionAlgs.get(encryptionAlgOID);

    if (algName != null)
    {
        return algName;
    }

    return encryptionAlgOID;
}

MessageDigest getDigestInstance(String algorithm, String provider) 
    throws NoSuchProviderException, NoSuchAlgorithmException {
    if (provider != null)
    {
        try
        {
            return MessageDigest.getInstance(algorithm, provider);
        }
        catch (NoSuchAlgorithmException e)
        {
            return MessageDigest.getInstance(algorithm); // try rolling back
        }
    }
    else
    {
        return MessageDigest.getInstance(algorithm);
    }
}
LDAP password hash matching in Java

LDAP password hash matching in Java


By : Noob
Date : March 29 2020, 07:55 AM
it fixes the issue That is base64 encoding. try it here
Updating ldap from java

Updating ldap from java


By : sof_user
Date : March 29 2020, 07:55 AM
this will help That assumption is indeed wrong.
LDAP is not a Windows-specific technology. All you need in order to update directory data is the ability to connect to the appropriate port (389 for unencrypted or TLS-encrypted connections, or 636 for SSL-encrypted connections) and bind to the LDAP server using the credentials of a user that has sufficient access to modify the attributes you have in mind.
Rolling Hash Algorithm for Rabin-Karp Algorithm Java

Rolling Hash Algorithm for Rabin-Karp Algorithm Java


By : Soheil Darestany
Date : March 29 2020, 07:55 AM
this will help You have a couple of fundamental problems in your code.
The first one is here: patternHash += int_mod(patternHash * base + pattern[i], primeMod); It is duplicated on a few more places.
code :
    segmentHash += int_mod(segmentHash * base + text[i + pattern.length -1],primeMod);
    segmentHash -= int_mod(segmentHash * base + text[i-1], primeMod);
Related Posts Related Posts :
  • how to use izpack to make my jar application to installer?
  • What is meant by src in Java Eclipse?
  • Create a mirrored linked list in Java
  • Examples of good JPA Java Desktop Application
  • Translate Java to Python -- signing strings with PEM certificate files
  • Algorithm Analysis tool for java
  • Java serial comm API - what does inputstream.read() return if a timeout occurs?
  • How do I make a background thread in Java that allows the main application to exit completely? This works in Linux, but
  • How to add an image dynamically at runtime in java
  • Java App on Mac asking for allow network connections everytime
  • Best actively maintained Java XMPP Library?
  • Multi-Threaded Application - Help with some pseudo code!
  • Scoping a StringBuilder inside a for loop
  • Class not found exception (org.apache.openjpa.enhance.PersistenceCapable) thrown in a client of WLS 10
  • In Java ,where in memory are class functions put?
  • How do I test expectedExceptionsMessageRegExp (exception message) using TestNG?
  • Help In understanding Multi Dimentional Arrays
  • No bean named '...' is defined and Spring @Resource annotation
  • Singleton design pattern vs Singleton beans in Spring container
  • flashvars object was not working in mozilla browser
  • Shell script to import mysql dump file
  • What are the best practices to separate data from users
  • May I use com.google.code prefix for my packages?
  • How to set classpath in manifest file , while creating JAR from eclipse?
  • dealing with voice in java
  • Error: java.security.AccessControlException: Access denied
  • How to verify the root trust of a ceritifcate
  • Searching for a standalone JSP compiler
  • Spring 2.5 managed servlets: howto?
  • iBatis get executed sql
  • GRAPH: find an algorithm to determine the shortest path from one point to another in a rectangular maze?
  • Efficient JSON encoding for data that may be binary, but is often text
  • How to Read Java File Structure using Java?
  • Java-Hibernate-Newbie: How do I acces the values from this list?
  • Smallest executable for Windows
  • Java: matching two different type of array
  • how to accept valid e-mail id in text box?
  • How can I know where a Null Pointer Exception originated?
  • Memory limited image processing in server
  • Java Multiple ResourceBundles
  • How to serialize Java primitives using Jersey REST
  • Casting objects to Integer,string ,
  • Using Java how can I plot the path of a sprite in a straight line?
  • IntelliJ shortcut for inserting a null check?
  • Eclipselink and update trigger on multiple access to the database
  • How to ICMPs and traceroutes in Java
  • "NOT_SUPPORTED_BY_GUI" Exception in JCo
  • Controlling the order of PicoContainer startup
  • Transposing and Untransposing a String in java
  • Spring MVC- several parts/views from a controller
  • Critical tools that every Java Developer should have in his toolbelt?
  • How to get the compression ratio for a GZipped file?
  • Does TestNG has runner like SpringJUnit4ClassRunner
  • Understanding Java Wait and Notify methods
  • Sorting a text file by date - Date looks like DD/MM/YYYY
  • Subtracting days in a Calendar object
  • How to store and retrieve object of a swing component in database, java
  • Java invalid stream header Problem
  • How to send parameters with same encoding from javascript?
  • Authentication and authorization frameworks for java GUI applications
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk