test_class.declarator: clientId = "client-id"
test_class.original_string: String clientId = "client-id";
test_class.type: String
test_class.var_name: clientId
test_class.declarator: keystorePath = "keystore-path"
test_class.original_string: String keystorePath = "keystore-path";
test_class.type: String
test_class.var_name: keystorePath
test_class.declarator: keystorePassword = "keystore-password"
test_class.original_string: String keystorePassword = "keystore-password";
test_class.type: String
test_class.var_name: keystorePassword
test_class.declarator: certificatePassword = "certificate-password"
test_class.original_string: String certificatePassword = "certificate-password";
test_class.type: String
test_class.var_name: certificatePassword
test_class.file: nvadaemon-azure/src/test/java/com/microsoft/azure/practices/nvadaemon/credentials/AzureClientIdCertificateCredentialFactoryImplTest.java
test_class.identifier: AzureClientIdCertificateCredentialFactoryImplTest
test_case.body: @Test
      void testInvalidFilePath() {
          AzureClientIdCertificateCredentialFactoryImpl factory =
              new AzureClientIdCertificateCredentialFactoryImpl(clientId,
              keystorePath, keystorePassword, certificatePassword);
          Assertions.assertThrows(GeneralSecurityException.class,
              () -> factory.create("resource"));
      }
test_case.class_method_signature: AzureClientIdCertificateCredentialFactoryImplTest.testInvalidFilePath()
test_case.full_signature: @Test void testInvalidFilePath()
test_case.identifier: testInvalidFilePath
test_case.invocations: assertThrows create
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalidFilePath()
focal_class.declarator: clientId
focal_class.modifier: private
focal_class.original_string: private String clientId;
focal_class.type: String
focal_class.var_name: clientId
focal_class.declarator: keyStorePath
focal_class.modifier: private
focal_class.original_string: private String keyStorePath;
focal_class.type: String
focal_class.var_name: keyStorePath
focal_class.declarator: keyStorePassword
focal_class.modifier: private
focal_class.original_string: private String keyStorePassword;
focal_class.type: String
focal_class.var_name: keyStorePassword
focal_class.declarator: certificatePassword
focal_class.modifier: private
focal_class.original_string: private String certificatePassword;
focal_class.type: String
focal_class.var_name: certificatePassword
focal_class.file: nvadaemon-azure/src/main/java/com/microsoft/azure/practices/nvadaemon/credentials/AzureClientIdCertificateCredentialFactoryImpl.java
focal_class.identifier: AzureClientIdCertificateCredentialFactoryImpl
focal_class.interfaces: implements AsymmetricKeyCredentialFactory
focal_class.class_method_signature: AzureClientIdCertificateCredentialFactoryImpl.AzureClientIdCertificateCredentialFactoryImpl(String clientId, String keyStorePath,
                                                           String keyStorePassword,
                                                           String certificatePassword)
focal_class.full_signature: public  AzureClientIdCertificateCredentialFactoryImpl(String clientId, String keyStorePath,
                                                           String keyStorePassword,
                                                           String certificatePassword)
focal_class.identifier: AzureClientIdCertificateCredentialFactoryImpl
focal_class.modifiers: public
focal_class.parameters: (String clientId, String keyStorePath,
                                                           String keyStorePassword,
                                                           String certificatePassword)
focal_class.signature:  AzureClientIdCertificateCredentialFactoryImpl(String clientId, String keyStorePath,
                                                           String keyStorePassword,
                                                           String certificatePassword)
focal_class.class_method_signature: AzureClientIdCertificateCredentialFactoryImpl.create(String resource)
focal_class.full_signature: @Override public AsymmetricKeyCredential create(String resource)
focal_class.identifier: create
focal_class.modifiers: @Override public
focal_class.parameters: (String resource)
focal_class.return: AsymmetricKeyCredential
focal_class.signature: AsymmetricKeyCredential create(String resource)
focal_method.body: @Override
      public AsymmetricKeyCredential create(String resource) throws GeneralSecurityException {
          // We don't care about the resource in our scenario, so we will ignore it.
          KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
  
          try (FileInputStream inputStream = new FileInputStream(
              this.keyStorePath)) {
              keyStore.load(inputStream, this.keyStorePassword.toCharArray());
              // Assuming there is only one entry here.
              String alias = keyStore.aliases().nextElement();
              KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry)keyStore.getEntry(alias,
                  new KeyStore.PasswordProtection(this.certificatePassword.toCharArray()));
              AsymmetricKeyCredential credential = AsymmetricKeyCredential.create(
                  this.clientId, privateKeyEntry.getPrivateKey(),
                  (X509Certificate)privateKeyEntry.getCertificate());
              return credential;
          } catch (IOException e) {
              throw new GeneralSecurityException("Could not load KeyStore file", e);
          }
      }
focal_method.class_method_signature: AzureClientIdCertificateCredentialFactoryImpl.create(String resource)
focal_method.full_signature: @Override public AsymmetricKeyCredential create(String resource)
focal_method.identifier: create
focal_method.invocations: getInstance getDefaultType load toCharArray nextElement aliases getEntry toCharArray create getPrivateKey getCertificate
focal_method.modifiers: @Override public
focal_method.parameters: (String resource)
focal_method.return: AsymmetricKeyCredential
focal_method.signature: AsymmetricKeyCredential create(String resource)