Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fc555e9
feat: initial version of azure developer signing library
Jaxelr Jan 9, 2024
60a33eb
feat: initial version of the Azure.Developer.Signing docs, tests & sa…
Jaxelr Feb 23, 2024
06e3512
tests: added recorded client tests for developer signing ops
Jaxelr Feb 27, 2024
f2bdb14
fix: rename fixes and simplification of client invocation
Jaxelr Feb 27, 2024
b946f5b
docs: update README.md with samples and tests
Jaxelr Feb 27, 2024
62eba02
docs: Update README.md with details
Jaxelr Mar 6, 2024
ce11c3d
fix: review feedback fixes
Jaxelr Mar 13, 2024
39d2237
fix: review feedback fixes
Jaxelr Mar 13, 2024
59f5840
feat: adding test resources needed to run the unit tests
Jaxelr Mar 14, 2024
4747390
feat: added tests.yml configuration
Jaxelr Mar 14, 2024
7c8530f
chore: adding service owners
Jaxelr Mar 14, 2024
1407287
chore: removed teammates temporarily
Jaxelr Mar 19, 2024
cfccf02
fix: linter errors
Jaxelr Mar 19, 2024
af1679a
fix: path of sdk should be developer-signing instead of developersigning
Jaxelr Mar 19, 2024
96c76f1
chore: update service owners with missing colon
Jaxelr Mar 20, 2024
2c8e108
chore: moved ci.yml configuration to parent directory
Jaxelr Mar 20, 2024
031a809
Update sdk/developer-signing/tests.yml
Jaxelr Mar 20, 2024
97078c3
Update .github/CODEOWNERS
Jaxelr Mar 20, 2024
1aa4896
fix: added test attribute
Jaxelr Mar 20, 2024
cef5ea9
fix: rebase building conflicts from autorest generation
Jaxelr Mar 20, 2024
8b983c7
docs: update links to samples to include sdk rename
Jaxelr Mar 22, 2024
663b482
docs: fix analyzer result from header information
Jaxelr Mar 22, 2024
f2b39c8
refactor: changed directory to trustedsigning per offline discussion …
Jaxelr Mar 22, 2024
e132fdb
fix: configuration of test resources for location value
Jaxelr Mar 23, 2024
a92e2c1
fix: result object was improperly mapped
Jaxelr Apr 23, 2024
7fbf8a2
Adding sessions record tests from our environment execution
Jaxelr Apr 23, 2024
5a50f52
docs: addition PR Label for Code Signing
Jaxelr Apr 25, 2024
63d5252
docs: Addition of impression pixel
Jaxelr Apr 25, 2024
ed17459
fix: remove unneeded suppression
Jaxelr Apr 25, 2024
a9c64d6
chore: update naming description and assembly title
Jaxelr Apr 25, 2024
677ee3a
tests: modify test value to ensure it matches record when reruns are …
Jaxelr Apr 25, 2024
f6729ea
tests: removed session records
Jaxelr Apr 25, 2024
d27e236
chore: added assets.json
Jaxelr Apr 25, 2024
1a05cbe
test: specific test must be run on async only
Jaxelr Apr 25, 2024
89d0b00
chore: added tag to developer signing asset
Jaxelr Apr 25, 2024
c98dd11
fix: test resources will be autopopulating parameters
Jaxelr May 2, 2024
96e00a7
chore: update sdk assets to latest tests
Jaxelr May 2, 2024
674f54c
swap test location for west europe
Jaxelr May 2, 2024
77ee790
Modified assets.json to proper place
Jaxelr May 2, 2024
b4f20d6
chore: update commit of rest api specs file
Jaxelr May 13, 2024
577c5ef
Revert "chore: update commit of rest api specs file"
Jaxelr May 13, 2024
67ca546
chore: update to use latest commit that modified azure-rest-api-specs
Jaxelr May 15, 2024
85b71bf
fix: trying a commit prior to the latest update
Jaxelr May 15, 2024
b252385
chore: using older commit
Jaxelr May 15, 2024
79e44f5
chore: Running Update Snippets
Jaxelr May 15, 2024
46a7f5f
fix: updated samples per rebase from main
Jaxelr Jul 5, 2024
28d2f83
test: signing client sdk update for tests
Jaxelr Jul 5, 2024
746f81c
chore: update samples to main version
Jaxelr Jul 5, 2024
48e13f5
tests: fix - removed the region
Jaxelr Jul 5, 2024
cef02a0
docs: update README.md information to include the links from trusted …
Jaxelr Jul 8, 2024
3878317
docs: remove locale information from url link
Jaxelr Jul 9, 2024
198d88e
fix: update trusted signing sdk
Jaxelr Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@
# ServiceLabel: %Bot Service
# ServiceOwners: @sgellock

#PRLabel %Code Signing
/sdk/trustedsigning/ @jaxelr

# ServiceLabel: %Code Signing
# ServiceOwners: @jaxelr
Comment thread
Jaxelr marked this conversation as resolved.
Outdated

# PRLabel: %Cognitive - Language
/sdk/cognitivelanguage/ @quentinRobinson @bidisha-c

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.Signing", "src\Azure.Developer.Signing.csproj", "{FC39285B-629E-4C91-8728-28C5CAE9CDA0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.Signing.Tests", "tests\Azure.Developer.Signing.Tests.csproj", "{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
{FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Release|Any CPU.Build.0 = Release|Any CPU
{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
13 changes: 13 additions & 0 deletions sdk/trustedsigning/Azure.Developer.Signing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

Initial release of the Azure developer signing library

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
154 changes: 154 additions & 0 deletions sdk/trustedsigning/Azure.Developer.Signing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Azure Developer Signing client library for .NET

Azure.Developer.Signing is a fully managed end-to-end signing solution for 3rd party developers. The Azure.Developer.Signing client library allows you to easily sign your bits without the hassle of managing certificate lifetimes.

Use the client library for Azure Developer Signing to:

* [Perform Signing of bits](https://learn.microsoft.com/azure/trusted-signing/how-to-signing-integrations/)
* [Access Signing information](https://learn.microsoft.com/azure/trusted-signing/how-to-sign-ci-policy/)

[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples]

[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/trustedsigning/Azure.Developer.Signing/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure)

## Getting started

### Install the package

Install the client library for .NET with [NuGet](https://www.nuget.org/ ):

```dotnetcli
dotnet add package Azure.Developer.Signing --prerelease
```

### Prerequisites

You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). It is recommended that you compile using the latest [.NET SDK](https://dotnet.microsoft.com/download) 6.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`.
Comment thread
Jaxelr marked this conversation as resolved.
Outdated

To have the capability to perform signing actions a Signing Account, Certificate Profile and Identity Validation must be created. These resources can be created using the Azure portal or the Azure CLI.

### Authenticate the client

To access the client, you can use the [Token Credential authentication](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) method provided by Standard Azure Active Directory. The identity interacting with the resource must have the role of `Code Signing Certificate Profile Signer` on the resource. These roles need to be assigned from the Azure portal or by using the Azure CLI.

To use Entra ID authentication, add the Azure Identity package:

`dotnet add package Azure.Identity`

You will also need to register a new AAD application, or run locally or in an environment with a managed identity. If using an application, set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET.

## Key concepts

This library interacts with the Azure Developer Signing service using two principal concepts, these are:

- `Trusted Signing Accounts` – A Signing Account is the logical container holding certificate profiles and identity validations and is considered a Azure Developer Signing resource.
- `Certificate Profile` – A Certificate Profile is the template with the information that is used in the issued certificates. It is a sub-resource to a Code Signing Account resource.
- `Identity Validation` - An Identity Validation resource is the identity of the legal business or individual. This information will be in the Subject Name of the certificates and therefore is a pre-requisite resource to be able to create a Certificate Profile.

Since the interaction of the client is at the certificate profile level, the client is designed to interact with this entity. A region must be provided to ensure the request is routed to the specific appropiate environment.

```C# Snippet:Azure_Developer_Signing_CreateCertificateProfileClient
var credential = new DefaultAzureCredential();
CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient();
```

### Thread safety

We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.

### Additional concepts
<!-- CLIENT COMMON BAR -->
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) |
[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
<!-- CLIENT COMMON BAR -->

## Examples

You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/trustedsigning/Azure.Developer.Signing/samples).

### Signing bytes

Sign the digest corresponding to a file using an algorithm.

```C# Snippet:Azure_Developer_Signing_SigningBytes
CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient();

using RequestContent content = RequestContent.Create(new
{
signatureAlgorithm,
digest,
});

Operation<BinaryData> operation = certificateProfileClient.Sign(WaitUntil.Completed, accountName, profileName, content);
BinaryData responseData = operation.Value;

JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
```

### List available customer extended key usages (EKUs)

Request all the available customer extended key usages from a certificate profile.

```C# Snippet:Azure_Developer_Signing_GetExtendedKeyUsages
CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient();

List<string> ekus = new();

foreach (BinaryData item in certificateProfileClient.GetExtendedKeyUsages(accountName, profileName, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
string eku = result.GetProperty("eku").ToString();

ekus.Add(eku);
}
```

### Download the root certificate

Request the sign root certificate from a certificate profile.

```C# Snippet:Azure_Developer_Signing_GetSignRootCertificate
CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient();

Response<BinaryData> response = certificateProfileClient.GetSignRootCertificate(accountName, profileName);

byte[] rootCertificate = response.Value.ToArray();
```

## Troubleshooting

Errors may occur during the Signing Action due to problems with Azure resources or your Azure configuration. You can view the `errorDetails` property on the SignResult if the signing action fails, it will show more information about the problem and how to resolve it.

Ensure that your client has the correct permissions to perform the action you are trying to perform. For example, if you are trying to sign a file, ensure that your client has the `Code Signing Certificate Profile Signer` role on the resource.

## Contributing

See the [DeveloperSigning CONTRIBUTING.md][developersigning_contrib] for details on building, testing, and contributing to this library.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments.

<!-- LINKS -->
[developersigning_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md
[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
[cla]: https://cla.microsoft.com
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[email_opencode]: mailto:opencode@microsoft.com

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/trustedsigning/Azure.Developer.Signing/README.png)

## Next steps

For more information on Azure SDK, please refer to [this website](https://azure.github.io/azure-sdk/)
Comment thread
Jaxelr marked this conversation as resolved.
Outdated

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftrustedsigning%2FAzure.Developer.Signing%2FREADME.png)
Loading