Asn1DerDecoder { public static boolean equalKeyAlgorithmSynonyms(String keyAlgorithm1, String keyAlgorithm2) { if (!keyAlgorithm1.equals(keyAlgorithm2)) { if (keyAlgorithm1.equals("DH") && keyAlgorithm2.equals("DiffieHellman")) { return true; } else if (keyAlgorithm2.equals("DH") && keyAlgorithm1.equals("DiffieHellman")) { return true; } return false; } return true; }  static Provider getEdDsaProvider(); static boolean isSupported(String algorithm); static byte[] readSequenceEntity(final DatagramReader reader); static byte[] readSequenceValue(final DatagramReader reader); static byte[] readOidValue(final DatagramReader reader); static String readOidString(final DatagramReader reader); static String readSubjectPublicKeyAlgorithm(final byte[] data); static PublicKey readSubjectPublicKey(final byte[] data); static String readPrivateKeyAlgorithm(final byte[] data); static Keys readPrivateKey(final byte[] data); static Keys readEcPrivateKeyV2(final byte[] data); static ECPublicKey readEcPublicKey(DatagramReader reader, ECParameterSpec ecParameterSpec); static PrivateKey ensureEdDsaPrivateKeyProvider(PrivateKey privateKey); static boolean equalKeyAlgorithmSynonyms(String keyAlgorithm1, String keyAlgorithm2); static ECParameterSpec getECParameterSpec(String oid); static String getEdDsaStandardAlgorithmName(String algorithm, String def); static final String EC; static final String RSA; static final String DSA; static final String DH; static final String ECv2; static final String ED25519; static final String ED448; static final String OID_ED25519; static final String OID_ED448; static final String EDDSA; static final int EC_PUBLIC_KEY_UNCOMPRESSED; }
@Test public void testEqualKeyAlgorithmSynonyms() throws NoSuchAlgorithmException { assertSynonym(true, "RSA", "RSA"); assertSynonym(true, "DH", "DiffieHellman"); assertSynonym(true, "DiffieHellman", "DiffieHellman"); assertSynonym(true, "DiffieHellman", "DH"); assertSynonym(false, "DH", "RSA"); assertSynonym(false, "DSA", "DiffieHellman"); }