private static void assertOAEPParametersEqual(OAEPParameterSpec expectedOaepSpec,
            OAEPParameterSpec actualOaepSpec) {
        assertEquals(expectedOaepSpec.getDigestAlgorithm(), actualOaepSpec.getDigestAlgorithm());

        assertEquals(expectedOaepSpec.getMGFAlgorithm(), actualOaepSpec.getMGFAlgorithm());
        if ("MGF1".equals(expectedOaepSpec.getMGFAlgorithm())) {
            MGF1ParameterSpec expectedMgf1Spec = (MGF1ParameterSpec) expectedOaepSpec
                    .getMGFParameters();
            MGF1ParameterSpec actualMgf1Spec = (MGF1ParameterSpec) actualOaepSpec
                    .getMGFParameters();
            assertEquals(expectedMgf1Spec.getDigestAlgorithm(),
                    actualMgf1Spec.getDigestAlgorithm());
        } else {
            fail("Unknown MGF algorithm: " + expectedOaepSpec.getMGFAlgorithm());
        }

        if (expectedOaepSpec.getPSource() instanceof PSource.PSpecified
                && actualOaepSpec.getPSource() instanceof PSource.PSpecified) {
            assertEquals(
                    Arrays.toString(
                            ((PSource.PSpecified) expectedOaepSpec.getPSource()).getValue()),
                    Arrays.toString(
                            ((PSource.PSpecified) actualOaepSpec.getPSource()).getValue()));
        } else {
            fail("Unknown PSource type");
        }
    }
Returns the key meant for deciphering for {@code algorithm}.
common/src/test/java/org/conscrypt/javax/crypto/CipherTest.java