Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault] Supported importing pem certificate by Import-AzKeyVaultCertificate #18644

Merged
merged 5 commits into from
Jun 28, 2022

Conversation

BethanyZhou
Copy link
Contributor

@BethanyZhou BethanyZhou commented Jun 21, 2022

Supported importing pem certificate by Import-AzKeyVaultCertificate [#18494]

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@BethanyZhou BethanyZhou added this to the July 2022 (2022-07-05) milestone Jun 24, 2022
@VeryEarly VeryEarly self-assigned this Jun 27, 2022
@@ -169,6 +199,11 @@ public override void ExecuteCmdlet()
}
}

private bool IsPemFile(string filePath)
{
return ".pem".Equals(Path.GetExtension(FilePath), StringComparison.OrdinalIgnoreCase);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filePath is the method parameter, FilePath is a property.

Suggested change
return ".pem".Equals(Path.GetExtension(FilePath), StringComparison.OrdinalIgnoreCase);
return ".pem".Equals(Path.GetExtension(filePath), StringComparison.OrdinalIgnoreCase);

return new PSKeyVaultCertificate(certClient.ImportCertificate(options));
}

public PSKeyVaultCertificate MergeCertifcate(string vaultName, string certName, byte[] certificate, IDictionary<string, string> tags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public PSKeyVaultCertificate MergeCertifcate(string vaultName, string certName, byte[] certificate, IDictionary<string, string> tags)
public PSKeyVaultCertificate MergeCertificate(string vaultName, string certName, byte[] certificate, IDictionary<string, string> tags)

@BethanyZhou BethanyZhou merged commit 4a44c97 into Azure:main Jun 28, 2022
@BethanyZhou BethanyZhou deleted the cert branch June 28, 2022 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import-AzKeyVaultCertificate yields Cannot find the requested object
3 participants