OneSpan Sign Developer: Upgrade in .NET SDK

Duo Liang,

OneSpan Sign offers simple and flexible REST-based APIs for your integrated application to consume. What’s more, our fully supported SDKs include pre-built API functionalities, making it even easier to add e-signature capabilities to your platform. If you develop with a .NET platform, get started with our .NET SDK is absolutely recommended to reduce the integration complexity.

As of version 11.33, we are excited to provide an upgraded .NET SDK which is both compatible to .NET Core and .NET framework. In this blog, we will introduce the key features of this upgrade and walk through the technical details. Let’s get started! 

Key Features of OneSpan Sign Version 11.33

.NET Standard 2.0 

.NET Standard is a common specification of .NET APIs which can be implemented by various .NET implementations — .NET framework, .NET core, etc. One of the amazing improvements in this upgrade is that we now support all implementations compliant with .NET standard 2.0. 

7-29-1
 
Note: 

  • Use the table above to determine if your project meets .NET standard 2.0 (referenced from Microsoft Official Guide).
  • For .NET framework projects, the SDK’s minimum requirement is version 4.5. 
  • To identify the .NET framework installed on your system, follow the instructions found on Microsoft’s documentation site.

Multi-platform Support

Since the SDK supports more .NET implementations, it’s possible to make your .NET code execute across different devices and systems, such as Windows, macOS, Linux, and even mobile platforms. This greatly boosts your integration power.

Rebranded SDK

In addition to numerous functional improvements, we also rebranded our SDK, including Namespace and Class names, to provide integrators with a more consistent and professional development experience. These changes may affect your existing projects. 

Download the Latest SDK

The.NET SDK is hosted once again on NuGet. Check the package page on the NuGet gallery, where you can find all the SDK history versions since 11.33.
If you use NuGet to manage project dependencies, use the command below in Package Manager Console to install the latest .NET SDK:

Install-Package OneSpanSign.Sdk -Version 11.35.0

Note: For other installation options via NuGet client tools, you will find all available commands from the NuGet package link above.

If you prefer to manage references by importing .dll files, you can click the “Download Package” link from NuGet gallery. This will download a NuGet package (.nupkg). By unzipping this package and exploring the “/lib/net45” or “/lib/netstandard2.0” path, you will find the compiled .dll file there.

If you are interested in the source code behind the SDK, we’ve also moved to a new Github repository

The Sample Code

Integrating with the upgraded .NET SDK is as simple as the previous experience. If you are not familiar with our .NET SDK, or it’s your first time creating a package programmatically, the code snippet below shows how to do so.

using OneSpanSign.Sdk;
using OneSpanSign.Sdk.Builder;
using System;
using System.Diagnostics;

namespace ConsoleApp
{
    class Program
    {
        private static string apiUrl = "https://sandbox.esignlive.com/api";
        private static string apiKey = "{your_api_key}";
        static void Main(string[] args)
        {
            OssClient ossClient = new OssClient(apiKey, apiUrl);
            
            DocumentPackage newPackage = PackageBuilder.NewPackageNamed("Example Package created from new .NET SDK")
                .DescribedAs("It's a test package")
                .WithEmailMessage("Please sign ASAP!")
                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                        .WithFirstName("John")
                        .WithLastName("Smith"))
                .WithDocument(DocumentBuilder.NewDocumentNamed("Document1")
                        .FromFile("{your_file_path}")
                        .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                            .OnPage(0).AtPosition(100,100).WithSize(150,50)))
                .WithStatus(DocumentPackageStatus.SENT)
                .Build();

            var packageId = ossClient.CreatePackageOneStep(newPackage);
            Debug.WriteLine("packageId: {0}", packageId);
        }
    }
}


Migrate from Previous SDK

If your project has already been integrated with a .NET SDK older than version 11.33 and your team decide to upgrade the SDK, one of the top concerns is that you need to change the Namespaces and Class names in your code. This is essential to make sure your code compiles with the latest SDK package. 

To migrate from "esl.sdk.net" to "oss.sdk.net" see the changes below:

  • Namespace has changed from "Silanis.ESL.SDK" to "OneSpanSign.Sdk"
  • Namespace has changed from "Silanis.ESL.API" to "OneSpanSign.API"
  • Class has been renamed from "EslClient" to "OssClient"
  • Class has been renamed from "EslException" to "OssException"
  • Class has been renamed from "EslServerException" to "OssServerException"
  • Class has been renamed from "EslEnumeration" to "OssEnumeration"

If you encounter any problem integrating with the latest .NET SDK or upgrading your existing project, or if you have anything else concerning integrating OneSpan Sign into your application, feel free to post your issue on our Developer Community Forums. Your feedback matters to us! 

OneSpan Developer Community

OneSpan Developer Community

Join the OneSpan Developer Community! Forums, blogs, documentation, SDK downloads, and more.

Join Today

Duo Liang is a Technical Evangelist and Partner Integrations Developer at OneSpan where he creates and maintains integration guides and code shares, helps customers and partners integrate OneSpan products into their applications, and builds integrations within third party platforms.