@Test public void verifyStoreUpdates() throws Exception { KeyStore keyStore = load(); KeyStore unmodifiable = UnmodifiableKeyStore.unmodifiableKeyStore(keyStore); assertEquals(1, unmodifiable.size()); assertTrue(unmodifiable.containsAlias(ALIAS)); testExpectUnsupportedOperationException(unmodifiable, (KeyStore k) -> k.deleteEntry(ALIAS)); testExpectUnsupportedOperationException(unmodifiable, (KeyStore k) -> k.setEntry(ALIAS, new SecretKeyEntry(getSecretKey()), protectionParameter)); testExpectUnsupportedOperationException(unmodifiable, (KeyStore k) -> k.setCertificateEntry(ALIAS, null)); testExpectUnsupportedOperationException(unmodifiable, (KeyStore k) -> k.load(null, null)); assertEquals(1, unmodifiable.size()); assertTrue(unmodifiable.containsAlias(ALIAS)); keyStore.deleteEntry(ALIAS); assertEquals(0, unmodifiable.size()); assertFalse(unmodifiable.containsAlias(ALIAS)); }
private UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { super(keyStoreSpi, provider, type); }
UnmodifiableKeyStore extends KeyStore { private UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { super(keyStoreSpi, provider, type); } }
UnmodifiableKeyStore extends KeyStore { private UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { super(keyStoreSpi, provider, type); } private  UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type); }
UnmodifiableKeyStore extends KeyStore { private UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { super(keyStoreSpi, provider, type); } private  UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type); static KeyStore unmodifiableKeyStore(final KeyStore toWrap); }
UnmodifiableKeyStore extends KeyStore { private UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { super(keyStoreSpi, provider, type); } private  UnmodifiableKeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type); static KeyStore unmodifiableKeyStore(final KeyStore toWrap);  }