public void regenerateStores(X509KeyType keyStoreKeyType, X509KeyType trustStoreKeyType,
    KeyStoreFileType keyStoreFileType, KeyStoreFileType trustStoreFileType,
    String... subjectAltNames)
    throws GeneralSecurityException, IOException, OperatorCreationException {

    trustStoreKeyPair = X509TestHelpers.generateKeyPair(trustStoreKeyType);
    keyStoreKeyPair = X509TestHelpers.generateKeyPair(keyStoreKeyType);
    createCertificates(subjectAltNames);

    switch (keyStoreFileType) {
      case JKS:
        generateKeyStoreJksFile();
        break;
      case PEM:
        generateKeyStorePemFile();
        break;
      case BCFKS:
        generateKeyStoreBcfksFile();
        break;
      case PKCS12:
        generateKeyStorePkcs12File();
        break;
    }

    switch (trustStoreFileType) {
      case JKS:
        generateTrustStoreJksFile();
        break;
      case PEM:
        generateTrustStorePemFile();
        break;
      case PKCS12:
        generateTrustStorePkcs12File();
        break;
      case BCFKS:
        generateTrustStoreBcfksFile();
        break;
    }
  }
Creates a clone of the current context, but injecting the passed certificate as the KeyStore
cert. The new context's keystore path fields are nulled, so the next call to
{@link #setConfigurations(KeyStoreFileType, KeyStoreFileType)},
{@link #setKeystoreConfigurations(KeyStoreFileType, Configuration)} , or
{@link #getKeyStoreFile(KeyStoreFileType)} will create a new keystore with this certificate in
place.
@param cert the cert to replace
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestContext.java