Code example for OAEPParameterSpec

Methods: getDigestAlgorithm

0
    } 
 
    private static boolean compareMD(OAEPParameterSpec s1,
        OAEPParameterSpec s2) {
        boolean result = false;
        String alg1 = s1.getDigestAlgorithm().toUpperCase().trim();
        String alg2 = s2.getDigestAlgorithm().toUpperCase().trim();
        alg1 = alg1.replaceAll("\\-", "");
        alg2 = alg2.replaceAll("\\-", "");
        if (alg1.equals("SHA") || alg1.equals("SHA1")) {
            result = (alg2.equals("SHA") || alg2.equals("SHA1"));
        } else { 
            result = (alg1.equals(alg2));
        } 
        return result;
    } 
 
 
    private static boolean compareMGF(OAEPParameterSpec s1,
        OAEPParameterSpec s2) {
Stop searching for code, let great code find you!  Add Codota to your java IDE