@Override public void execute() throws Exception { ApplicationContext appContext = context.getApplicationContext(); Protector protector = appContext.getBean(Protector.class); if (protector instanceof KeyStoreBasedProtector) { KeyStoreBasedProtector p = (KeyStoreBasedProtector) protector; System.out.println("Location: " + p.getKeyStorePath()); } KeyStore keyStore = protector.getKeyStore(); System.out.println("Type: " + keyStore.getType()); Provider provider = keyStore.getProvider(); System.out.println("Provider: " + provider.getName()); Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { String alias = aliases.nextElement(); System.out.println("======"); describeAlias(keyStore, alias, protector); if (aliases.hasMoreElements()) { System.out.println("======"); } } // todo implement dump other keys from keystore }
KeyStoreBasedProtector impl = (KeyStoreBasedProtector) protector; String name = impl.getSecretKeyDigest(key); System.out.println(" Key name: " + name);