@Test public void md5HexTest() { String md5Hex = OadrPKISecurity.md5Hex("mouaiccool"); assertEquals("f2d3fcdce97f021064356321534e2fda", md5Hex); }
public static String md5Hex(String data) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm available!", e); } return new String(Hex.encode(digest.digest(data.getBytes()))); }
OadrPKISecurity { public static String md5Hex(String data) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm available!", e); } return new String(Hex.encode(digest.digest(data.getBytes()))); } }
OadrPKISecurity { public static String md5Hex(String data) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm available!", e); } return new String(Hex.encode(digest.digest(data.getBytes()))); } private  OadrPKISecurity(); }
OadrPKISecurity { public static String md5Hex(String data) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm available!", e); } return new String(Hex.encode(digest.digest(data.getBytes()))); } private  OadrPKISecurity(); static PrivateKey parsePrivateKey(String privateKeyFilePath); static PrivateKey parsePrivateKey(FileReader fileReader); static X509Certificate parseCertificate(String certificateFilePath); static X509Certificate parseCertificate(FileReader fileReader); static KeyStore createKeyStore(String privateKeyFilePath, String clientCertificatefilePath, String password); static KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
			String clientCertificatePemFilePath, String password); static KeyStore createTrustStore(List<String> certificates); static TrustManagerFactory createTrustManagerFactory(List<String> trustedCertificateFilePath); static SSLContext createSSLContext(String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
			List<String> trustCertificates, String password); static String md5Hex(String data); static KeyPair generateRsaKeyPair(); static KeyPair generateEccKeyPair(); static OadrUserX509Credential generateCredentials(KeyPair caKeyPair, X509Certificate caCert,
			String commonName, OadrPKIAlgorithm algo); }
OadrPKISecurity { public static String md5Hex(String data) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm available!", e); } return new String(Hex.encode(digest.digest(data.getBytes()))); } private  OadrPKISecurity(); static PrivateKey parsePrivateKey(String privateKeyFilePath); static PrivateKey parsePrivateKey(FileReader fileReader); static X509Certificate parseCertificate(String certificateFilePath); static X509Certificate parseCertificate(FileReader fileReader); static KeyStore createKeyStore(String privateKeyFilePath, String clientCertificatefilePath, String password); static KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
			String clientCertificatePemFilePath, String password); static KeyStore createTrustStore(List<String> certificates); static TrustManagerFactory createTrustManagerFactory(List<String> trustedCertificateFilePath); static SSLContext createSSLContext(String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
			List<String> trustCertificates, String password); static String md5Hex(String data); static KeyPair generateRsaKeyPair(); static KeyPair generateEccKeyPair(); static OadrUserX509Credential generateCredentials(KeyPair caKeyPair, X509Certificate caCert,
			String commonName, OadrPKIAlgorithm algo);  }