    @Test
    public void testPromoteDivertSpecific() throws Exception {

        PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.application,
                new ProviderHelper(RuntimeEnvironment.application), null, null);

        byte[] aid = Hex.decode("D2760001240102000000012345670000");

        // only promote the first, rest stays dummy
        long keyId = KeyringTestingHelper.getSubkeyId(mStaticRing, 1);

        PromoteKeyResult result = op.execute(mStaticRing.getMasterKeyId(), aid, new long[] {
            keyId
        });

        Assert.assertTrue("promotion must succeed", result.success());

        {
            CanonicalizedSecretKeyRing ring = new ProviderHelper(RuntimeEnvironment.application)
                    .getCanonicalizedSecretKeyRing(mStaticRing.getMasterKeyId());

            for (CanonicalizedSecretKey key : ring.secretKeyIterator()) {
                if (key.getKeyId() == keyId) {
                    Assert.assertEquals("subkey must be divert-to-card",
                            SecretKeyType.DIVERT_TO_CARD, key.getSecretKeyType());
                    Assert.assertArrayEquals("subkey must have correct iv",
                            aid, key.getIv());
                } else {
                    Assert.assertEquals("some subkeys must be gnu dummy",
                            SecretKeyType.GNU_DUMMY, key.getSecretKeyType());
                }
            }

        }
    }