class OrientKeyStoreStorage extends ComponentSupport implements KeyStoreStorage {

  @Override
  public void save(final KeyStore keyStore, final char[] password)
      throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
  {
    ByteArrayOutputStream baos = new ByteArrayOutputStream(16 * 1024);
    keyStore.store(baos, password);
    OrientKeyStoreData entity = new OrientKeyStoreData();
    entity.setName(keyStoreName);
    entity.setBytes(baos.toByteArray());
    storageManager.save(entity);
    loadedVersion = entity.getEntityMetadata().getVersion();
    log.debug("Saved version {} of key store {}", loadedVersion, keyStoreName);
  }

  public  OrientKeyStoreStorage(final OrientKeyStoreStorageManager storageManager, final String keyStoreName);

}