YopassSharp 1.5.1
dotnet add package YopassSharp --version 1.5.1
NuGet\Install-Package YopassSharp -Version 1.5.1
<PackageReference Include="YopassSharp" Version="1.5.1" />
<PackageVersion Include="YopassSharp" Version="1.5.1" />
<PackageReference Include="YopassSharp" />
paket add YopassSharp --version 1.5.1
#r "nuget: YopassSharp, 1.5.1"
#:package YopassSharp@1.5.1
#addin nuget:?package=YopassSharp&version=1.5.1
#tool nuget:?package=YopassSharp&version=1.5.1
YopassSharp
YopassSharp is a C# client library for Yopass, a secure sharing solution for secrets using end-to-end encryption.
This library allows you to easily create encrypted secret links programmatically.
🚀 Features
- Create encrypted Yopass links directly from C#
- Strong AES-256 + PGP encryption under the hood (via BouncyCastle)
- Fully configurable API endpoints, decryption key length, and HTTP method
- Async/await support
- Built-in URL builders for short and full links
📦 Installation
dotnet add package YopassSharp
🛠 API Overview
YopassClient
Main class to create secure links.
Implements IYopassClient.
Methods:
Task<YopassResult> CreateLinkAsync(string message)
Creates a secret using a randomly generated decryption key and default expiration (OneHour).Task<YopassResult> CreateLinkAsync(string message, string? decryptenKey)
Creates a secret using a provided or generated decryption key and default expiration (OneHour).Task<YopassResult> CreateLinkAsync(string message, ExpirationSeconds expiration)
Creates a secret using a randomly generated decryption key and a custom expiration.Task<YopassResult> CreateLinkAsync(string message, string? decryptenKey, ExpirationSeconds expiration)
Creates a secret using a provided or generated decryption key and a custom expiration.
YopassResult
YopassResult represents the outcome of creating a Yopass link. It contains all important information about the secret, including ID, decryption key, generated URLs, and status.
class YopassResult
{
bool Success; // True if the link creation was successful
string SecretId = ""; // Unique secret ID returned by the Yopass API
string DecryptenKey = ""; // Key needed to decrypt the secret
// Short link (example)
string ShortUrl => "https://yopass.se/#/s/abcd1234";
// Full link (example)
string FullUrl => "https://yopass.se/#/s/abcd1234#mySecretKey";
string? ErrorMessage = null; // Error message if creation failed
}
Field Explanation:
Success– Indicates whether the secret creation was successful.SecretId– Unique identifier of the secret returned by the Yopass server.DecryptenKey– The key used to decrypt the secret; required to read the content.ShortUrl– Short link pointing to the secret page (without the key). Useful when the key is sent separately.FullUrl– Full link including the decryption key. Can be used directly to access the secret.ErrorMessage– Contains the error message if creation failed (e.g., network or API errors).
Example Usage:
var result = await client.CreateLinkAsync("My secret password");
if (result.Success)
{
Console.WriteLine(result.ShortUrl); // e.g., https://yopass.se/#/s/abcd1234
Console.WriteLine(result.FullUrl); // e.g., https://yopass.se/#/s/abcd1234#mySecretKey
}
else
{
Console.WriteLine(result.ErrorMessage); // e.g., "API request failed"
}
YopassConfig
Defines configuration for YopassClient.
Default values:
- UrlBase:
yopass.se - ApiBase:
api.yopass.se - ApiEndpoint:
secret - Method:
POST - DecryptenKeyLength:
12
You can override this by providing a custom config.
⚡ Quickstart
using System;
using System.Threading.Tasks;
using YopassSharp;
class Program
{
static async Task Main()
{
var client = new YopassClient();
var result = await client.CreateLinkAsync("Hello secure world!");
if (result.Success)
{
Console.WriteLine($"Short URL: {result.ShortUrl}");
Console.WriteLine($"Full URL: {result.FullUrl}");
}
else
{
Console.WriteLine($"Error: {result.ErrorMessage}");
}
}
}
⚙️ Configuration
using YopassSharp;
using YopassSharp.Config;
using RestSharp;
var config = new YopassConfig(
urlBase: "yourdomain.de",
apiBase: "api.yourdomain.de",
apiEndpoint: "secret",
method: Method.Post,
decryptenKeyLength: 16
);
var client = new YopassClient(config);
var result = await client.CreateLinkAsync("Custom instance test", ExpirationSeconds.OneDay);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Portable.BouncyCastle (>= 1.9.0)
- RestSharp (>= 112.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.1 | 202 | 9/30/2025 |