NuGet

DidiSoft OpenPGP Library for .NET is available for download via NuGet. On this page, you will find details on how to setup our private repository and obtain the production version of the library from there.

Contents

Visual Studio

Azure DevOps or CI/CD

Trial Version

Getting the trial version from Nuget:

PM> Install-Package DidiSoft.Pgp.Trial

Production Version

The production NuGet feed is only for existing customers. It is protected with username and password. Below are the details that you have to use in order to access the production feed.

Private Nuget Repository
URL: https://repo.didisoft.com/repository/nuget/

PM> Uninstall-Package DidiSoft.Pgp.Trial

PM> Install-Package DidiSoft.Pgp

At the first execution of Install-Package a login dialog will appear and you have to enter:

Username: your email address is used to access our customers’ section. | Convert it to a Lower case like: John.Doe@acm.com -> john.doe@acm.com
Password: your email address is used to access our customers’ section. | Convert it to a Lower case like: John.Doe@acm.com -> john.doe@acm.com

(If you don’t remember it, please don’t hesitate to drop us a line)

Registering the Private NuGet feed in Visual Studio

In Microsoft Visual Studio select Tools > NuGet Package Manager > Package Manager Settings

In the tree view select Package Sources – and add a new source with details:
Name: DidiSoft.Pgp
Source: https://repo.didisoft.com/repository/nuget/

Install the production Package in your project

In order to install the library in your .NET projects type in the Package Manager console:

Install-Package DidiSoft.Pgp

Troubleshooting

On the first attempt to Install the production version from the private NuGet repository, a login dialog will appear where you have to enter in both fields your registered email address (all lowercase).

If the email is misspelled, you have to correct it in the Windows Credentials Manager.

Open Control Panel > Credential Manager > Windows Credentials

Windows Credentials

And edit the username/password to be your registered email (all lowercase) for the Entries:

repo.didisoft.com and VSCredentials_repo.didisoft.com

VS Nuget credentials

Then we have to restart Visual Studio and at that time should be able to install the package.

Azure DevOps

In projects that are set up to build with Azure DevOps, we have to describe the NuGet feed in a nuget.config text file like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="..\..\..\tmp\packages" />
  </config>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="DidiSoftPgp" value="https://repo.didisoft.com/repository/nuget/" />
  </packageSources>
  <packageSourceCredentials>
    <DidiSoftPgp>
      <add key="Username" value="your email lowercase" />
      <add key="ClearTextPassword" value="your email lowercase" />
    </DidiSoftPgp>
  </packageSourceCredentials>
</configuration>

Unfortunately, this way your credentials are exposed.

A much better solution is to set the authentication inside a Service connection. We can modify the nuget.config to contain only a reference to the feed “DidiSoftPgp“, and let the Service connection perform the authentication:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="tmp\packages" />
  </config>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="DidiSoftPgp" value="https://repo.didisoft.com/repository/nuget/" />
  </packageSources>
</configuration>

NuGet Service connection

In your DevOps Project Settings, add a new Service connection of type NuGet. This Service connection allows build pipelines to fetch packages from our private Nuget feed.

Azure DevOps NuGet

Enter the private repository URL and Basic authentication with username/password. For the example, we will name the NuGet service connection “DidiSoftPgp”.

The next step is to add a NuGet restore Task before the task that builds our application:

Now when your Azure DevOps build is executed, it will automatically download the DidiSoft Pgp assemblies before performing the build task.

CI/CD scenario

In CI/CD scenario, for example in GitHub Actions or with Jenkins, we can define the username/password as environment variables in nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="..\..\..\tmp\packages" />
  </config>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="DidiSoftPgp" value="https://repo.didisoft.com/repository/nuget/" />
  </packageSources>
  <packageSourceCredentials>
    <DidiSoftPgp>
      <add key="Username" value="%DIDISOFT_USER%" />
      <add key="ClearTextPassword" value="%DIDISOFT_PASS%" />
    </DidiSoftPgp>
  </packageSourceCredentials>
</configuration>

and set them via Shell script or PowerShell script beforehand:

# Use secrets to set nuget.config packageSourceCredentials's environment variables
$env:DIDISOFT_USER = '$(MyEmail)'
$env:DIDISOFT_PASS ='$(MyPassword)'
 
# Restore the dependencies
dotnet restore src/MyApp.sln --configfile src/nuget.config --runtime any

 

Summary

This article contains details on how to access DidiSoft’s private NuGet feed. The trial package is available as DidiSoft.Pgp.Trial on Nuget.org. Customers who have already purchased the library must use our private Nuget repository located at https://repo.didisoft.com/repository/nuget/. If you have any trouble interacting with our NuGet repository, please contact our support department.