@Test public void load_nullName() { when(this.keyStorage.load(null)).thenThrow(KeyEntryNotFoundException.class); assertThrows(KeyEntryNotFoundException.class, () -> { storage.load(null); }); }
public Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName) throws CryptoException { KeyEntry keyEntry = this.keyStorage.load(keyName); if (keyEntry != null) { VirgilPrivateKey privateKey = this.keyExporter.importPrivateKey(keyEntry.getValue()); Tuple<VirgilPrivateKey, Map<String, String>> pair = new Tuple<>( privateKey, keyEntry.getMeta()); return pair; } return null; }
PrivateKeyStorage { public Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName) throws CryptoException { KeyEntry keyEntry = this.keyStorage.load(keyName); if (keyEntry != null) { VirgilPrivateKey privateKey = this.keyExporter.importPrivateKey(keyEntry.getValue()); Tuple<VirgilPrivateKey, Map<String, String>> pair = new Tuple<>( privateKey, keyEntry.getMeta()); return pair; } return null; } }
PrivateKeyStorage { public Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName) throws CryptoException { KeyEntry keyEntry = this.keyStorage.load(keyName); if (keyEntry != null) { VirgilPrivateKey privateKey = this.keyExporter.importPrivateKey(keyEntry.getValue()); Tuple<VirgilPrivateKey, Map<String, String>> pair = new Tuple<>( privateKey, keyEntry.getMeta()); return pair; } return null; } PrivateKeyStorage(VirgilPrivateKeyExporter keyExporter, KeyStorage keyStorage); }
PrivateKeyStorage { public Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName) throws CryptoException { KeyEntry keyEntry = this.keyStorage.load(keyName); if (keyEntry != null) { VirgilPrivateKey privateKey = this.keyExporter.importPrivateKey(keyEntry.getValue()); Tuple<VirgilPrivateKey, Map<String, String>> pair = new Tuple<>( privateKey, keyEntry.getMeta()); return pair; } return null; } PrivateKeyStorage(VirgilPrivateKeyExporter keyExporter, KeyStorage keyStorage); void delete(String keyName); boolean exists(String keyName); Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName); Set<String> names(); void store(VirgilPrivateKey privateKey, String name, Map<String, String> meta); }
PrivateKeyStorage { public Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName) throws CryptoException { KeyEntry keyEntry = this.keyStorage.load(keyName); if (keyEntry != null) { VirgilPrivateKey privateKey = this.keyExporter.importPrivateKey(keyEntry.getValue()); Tuple<VirgilPrivateKey, Map<String, String>> pair = new Tuple<>( privateKey, keyEntry.getMeta()); return pair; } return null; } PrivateKeyStorage(VirgilPrivateKeyExporter keyExporter, KeyStorage keyStorage); void delete(String keyName); boolean exists(String keyName); Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName); Set<String> names(); void store(VirgilPrivateKey privateKey, String name, Map<String, String> meta);  }