@Test void storePrivateKeyToDirectoryWithoutSubjectID() throws Exception { when(certificate.getExtensions()).thenReturn(null); when(certificate.getSubjectKeyIdentifier()).thenReturn(null); store.store(MULTI_STORE_REF, keyPair); assertThat(FileUtils.readFileToString(new File(DIRECTORY, SERIAL + ", " + ISSUER + ".key")), equalTo(KEY_FILE_CONTENT)); assertThat(FileUtils.readFileToString(new File(DIRECTORY, SERIAL + ", " + ISSUER + ".cert")), equalTo(CERTIFICATE_FILE_CONTENT)); }
@Override public void store(StoreReference store, CertifiedKeyPair keyPair) throws KeyStoreException { storeKeyPair(store, getPublicKey(keyPair.getCertificate()), keyPair.getPrivateKey().getEncoded(), PRIVATE_KEY); }
X509KeyFileSystemStore extends AbstractX509FileSystemStore implements KeyStore { @Override public void store(StoreReference store, CertifiedKeyPair keyPair) throws KeyStoreException { storeKeyPair(store, getPublicKey(keyPair.getCertificate()), keyPair.getPrivateKey().getEncoded(), PRIVATE_KEY); } }
X509KeyFileSystemStore extends AbstractX509FileSystemStore implements KeyStore { @Override public void store(StoreReference store, CertifiedKeyPair keyPair) throws KeyStoreException { storeKeyPair(store, getPublicKey(keyPair.getCertificate()), keyPair.getPrivateKey().getEncoded(), PRIVATE_KEY); }  }
X509KeyFileSystemStore extends AbstractX509FileSystemStore implements KeyStore { @Override public void store(StoreReference store, CertifiedKeyPair keyPair) throws KeyStoreException { storeKeyPair(store, getPublicKey(keyPair.getCertificate()), keyPair.getPrivateKey().getEncoded(), PRIVATE_KEY); }  @Override void store(StoreReference store, CertifiedKeyPair keyPair); @Override void store(StoreReference store, CertifiedKeyPair keyPair, byte[] password); @Override CertifiedKeyPair retrieve(StoreReference store); @Override CertifiedKeyPair retrieve(StoreReference store, byte[] password); @Override CertifiedKeyPair retrieve(StoreReference store, CertifiedPublicKey publicKey); @Override CertifiedKeyPair retrieve(StoreReference store, CertifiedPublicKey publicKey, byte[] password); }
X509KeyFileSystemStore extends AbstractX509FileSystemStore implements KeyStore { @Override public void store(StoreReference store, CertifiedKeyPair keyPair) throws KeyStoreException { storeKeyPair(store, getPublicKey(keyPair.getCertificate()), keyPair.getPrivateKey().getEncoded(), PRIVATE_KEY); }  @Override void store(StoreReference store, CertifiedKeyPair keyPair); @Override void store(StoreReference store, CertifiedKeyPair keyPair, byte[] password); @Override CertifiedKeyPair retrieve(StoreReference store); @Override CertifiedKeyPair retrieve(StoreReference store, byte[] password); @Override CertifiedKeyPair retrieve(StoreReference store, CertifiedPublicKey publicKey); @Override CertifiedKeyPair retrieve(StoreReference store, CertifiedPublicKey publicKey, byte[] password);  }