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

Prepare for Native AOT #246

Merged
merged 13 commits into from
May 6, 2024
5 changes: 3 additions & 2 deletions src/AzureSign.Core/AzureSign.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<Description>Authenticode signing library.</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<MinVerTagPrefix>v</MinVerTagPrefix>
<Nullable>enable</Nullable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
Expand Down
108 changes: 108 additions & 0 deletions src/AzureSignTool/AboutCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System.Threading.Tasks;
using XenoAtom.CommandLine;

namespace AzureSignTool
{

internal sealed class AboutCommand : Command
{
internal AboutCommand() : base("about", "About AzureSignTool and 3rd party dependencies.", null)
{
Action = Run;
}

private static ValueTask<int> Run(CommandRunContext context, string[] arguments)
{
context.Out.WriteLine("""
License notice for XenoAtom.CommandLine
Originally from: https://github.com/XenoAtom/XenoAtom.CommandLine/blob/b48056d2fb6874acd89c3f54feccf5acf028a2dd/license.txt
-------------------------------
Copyright (c) 2024, Alexandre Mutel
All rights reserved.

Redistribution and use in source and binary forms, with or without modification
, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

------------------------------------------------------------------------------

XenoAtom.CommandLine is a derivative work from Mono.Options.cs, which is
licensed under the following MIT License.

Authors:
Jonathan Pryor <jpryor@novell.com>, <Jonathan.Pryor@microsoft.com>
Federico Di Gregorio <fog@initd.org>
Rolf Bjarne Kvinge <rolf@xamarin.com>

Copyright (C) 2008 Novell (http://www.novell.com)
Copyright (C) 2009 Federico Di Gregorio.
Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)
Copyright (C) 2017 Microsoft Corporation (http://www.microsoft.com)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


License notice for the Microsoft Azure SDK
Originally from: https://github.com/Azure/azure-sdk-for-net/blob/5b4c4f6d9cba7eb038dfeb13ef1cfb2024a6708c/LICENSE.txt
-------------------------------

The MIT License (MIT)

Copyright (c) 2015 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
""".ReplaceLineEndings());
return ValueTask.FromResult(0);
}
}
}
2 changes: 2 additions & 0 deletions src/AzureSignTool/AuthorityHostNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ internal static class AuthorityHostNames
KeyValuePair.Create("public", AzureAuthorityHosts.AzurePublicCloud),
]);

public static IEnumerable<string> Keys => _map.Keys;

public static Uri? GetUriForAzureAuthorityIdentifier(string identifier)
{
if (_map.TryGetValue(identifier, out Uri? host))
Expand Down
13 changes: 9 additions & 4 deletions src/AzureSignTool/AzureSignTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>azuresigntool</ToolCommandName>
<Description>Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.</Description>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<MinVerTagPrefix>v</MinVerTagPrefix>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishAot>true</PublishAot>
<EventSourceSupport>false</EventSourceSupport>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<OptimizationPreference>Size</OptimizationPreference>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.11.0" />
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.0" />
<PackageReference Include="Azure.Identity" Version="1.11.2" />
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.6.0" />
<PackageReference Include="Azure.Security.KeyVault.Keys" Version="4.6.0" />
<PackageReference Include="XenoAtom.CommandLine" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="MinVer" Version="4.3.0">
Expand Down
25 changes: 0 additions & 25 deletions src/AzureSignTool/CommandLineAttributes.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/AzureSignTool/CommandLineParsers.cs

This file was deleted.

Loading