---
title: "Apply the License Key for .NET Core PDF SDK | ComPDF"
canonical_url: "https://www.compdf.com/guides/pdf-sdk/dotnet-core/apply-the-license-key"
md_url: "https://www.compdf.com/guides/pdf-sdk/dotnet-core/apply-the-license-key.md"
description: "Learn how to apply the license key step by step and covering online and offline authentication methods to use the ComPDF .NET Core PDF SDK."
---

# Apply the License Key

If you haven't get a license key, please check out [how to obtain a license key](https://www.compdf.com/guides/pdf-sdk/dotnet-core/requirements).

ComPDF PDF SDK currently supports two authentication methods to verify license keys: online authentication and offline authentication.

_Learn about:_

-   [_What is the authentication mechanism of ComPDFKit's license?_](https://www.compdf.com/faq/authentication-mechanism-of-compdfkit-license)
    
-   [_What are the differences between Online Authentication and Offline Authentication?_](https://www.compdf.com/faq/the-differences-between-online-authentication-and-offline-authentication)
    

## Copying the License Key

After getting the license key, follow the steps below to apply it to your project.

1.  In the email you received, locate the `XML` file containing the license key.
    
2.  Copy the license key `XML` file to your own project.
    

## Apply the License Key

You can perform authentication using the following method:

```C#
public static bool LicenseVerify()
{
	if (!CPDFSDKVerifier.LoadNativeLibrary())
	{ 
		return false;
	}
	string xmlPath = "The path to your license key XML file";
	LicenseErrorCode status = CPDFSDKVerifier.LicenseVerify(xmlPath);
	return status == LicenseErrorCode.E_LICENSE_SUCCESS;
}
```
