GithubHelp home page GithubHelp logo

developer82 / rsakeyvaultprovider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from novotnyllc/rsakeyvaultprovider

0.0 0.0 0.0 215 KB

Enables Azure Key Vault secrets and certificates to be used by .NET Crypto

License: MIT License

C# 100.00%

rsakeyvaultprovider's Introduction

About

The RSAKeyVaultProvider enables you to use secrets and certificates stored in an Azure Key Vault for performing signing and decryption operations. (Encrypt and verify can be done locally with the public key material.) The type derives from RSA so can be used anywhere an AsymmetricAlgorithm can be, including with SignedXml types.

Package

NuGet: RSAKeyVaultProvider
RSAKeyVaultProvider

CI feed is on Azure Artifacts: https://pkgs.dev.azure.com/clairernovotny/GitBuilds/_packaging/RSAKeyVaultProvider/nuget/v3/index.json
RSAKeyVaultProvider package in RSAKeyVaultProvider feed in Azure Artifacts

Setup

To run these tests, you'll need to import a code signing certificate into an Azure Key Vault. You can do this by importing the PFX for certs you already have, or, the harder way, by generating a CSR in the HSM and using that for an EV Code Signing certificate. You will also need to create a new RSA key using Add-AzureKeyVaultKey or the UI mentioned below. Use the key name as the azureKeyVaultKeyName in the config and the certificate name as the azureKeyVaultCertificateName.

You can also use the Azure Portal to generate a new key and certificate. In the cetificate make sure to go to the advanced policies and select "Data Encipherment" so that it can do the decrypt tests.

Create a service principal / application and grant it access to the Key Vault with the following permissions:

Category Permission
Key Get, Sign, Decrypt
Certificate Get

You'll need to drop a json file called azure-creds.json in the tests private directory with the following values:

{
  "clientId": "",
  "clientSecret": "",
  "tenantId": "",
  "azureKeyVaultUrl": "",
  "azureKeyVaultCertificateName": "",
  "azureKeyVaultKeyName": "" 
}

Azure Key Vault Explorer

There's a handy GUI for accessing Key Vault and includes support for importing certificates: https://github.com/elize1979/AzureKeyVaultExplorer

The app defaults to logging into an @microsoft.com account, so if you want to connect to a different directory, you need to change the settings first. Change the Authority to https://login.windows.net/common and edit the DomainHints value to have your AAD domain(s) in it.

rsakeyvaultprovider's People

Contributors

arhandres avatar clairernovotny avatar dependabot-preview[bot] avatar dependabot[bot] avatar kevinchalet avatar vcsjones avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.