Yopass.API 0.9.0

dotnet add package Yopass.API --version 0.9.0
                    
NuGet\Install-Package Yopass.API -Version 0.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Yopass.API" Version="0.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yopass.API" Version="0.9.0" />
                    
Directory.Packages.props
<PackageReference Include="Yopass.API" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Yopass.API --version 0.9.0
                    
#r "nuget: Yopass.API, 0.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Yopass.API@0.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Yopass.API&version=0.9.0
                    
Install as a Cake Addin
#tool nuget:?package=Yopass.API&version=0.9.0
                    
Install as a Cake Tool

Nuget Nuget Downloads Build Status

Yopass.API

Yopass.API is a .NET library written in F# that provides a wrapper for interacting with the Yopass service, either the original one at https://yopass.se or self-hosted.

Yopass is a tool for securely sharing secrets using a one-time URL. When using the site directly encryption happens locally in the browser, and the encrypted secret is never sent to the server. This library does the same thing that the browser does, but at API level, encrypting and decrypting secrets inside your .NET application (F# or C#).

Features

  • Encrypt and decrypt secrets using Yopass
  • Generate secure encryption keys
  • Configure Yopass service settings

Installation

To install the Yopass.API library, add it to your project using the .NET CLI:

dotnet add package Yopass.API

Usage

Encrypting and Decrypting Secrets

For F#

open Yopass

// Create a wrapper with default settings
let yopass = Wrapper()

// Or create with custom settings
// let yopass = Wrapper(url = "https://yopass.se", api = "https://api.yopass.se", 
//                      expiration = 3600, oneTime = true)

let secret = "my secret"
let encrypted = yopass.encrypt secret
let decrypted = encrypted |> yopass.decryptString

printfn "Encrypted: %s" encrypted
printfn "Decrypted: %s" decrypted

For C#

using Yopass;
using System;

// Create a wrapper with default settings
var yopass = new Wrapper();

// Or create with custom settings
// var yopass = new Wrapper(url: "https://yopass.se", api: "https://api.yopass.se", 
//                          expiration: 3600, oneTime: true);

string secret = "my secret";
string encrypted = yopass.encrypt(secret);
string decrypted = yopass.decryptString(encrypted);

Console.WriteLine($"Encrypted: {encrypted}");
Console.WriteLine($"Decrypted: {decrypted}");

Using a Custom Key

open Yopass

let yopass = Wrapper(key = "some key")
let secret = "my secret"

let encrypted = secret |> yopass.encrypt
let decrypted = encrypted |> yopass.decryptString
using Yopass;

var yopass = new Wrapper(key: "some key");
string secret = "my secret";

string encrypted = yopass.encrypt(secret);
string decrypted = yopass.decryptString(encrypted);

Generating a Secure Key

Yopass.Wrapper options :

Option Description Default
url The URL of the Yopass service https://yopass.se
api The URL of the Yopass API https://api.yopass.se
expiration The expiration time in seconds 3600
oneTime Whether the secret is one-time true
key The encryption key Optional

Building

Launch the build process using the .NET CLI:

dotnet restore
dotnet build

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.9.0 149 3/14/2025