Skip to content

Commit

Permalink
Merge pull request #30 from Devolutions/fix-branch
Browse files Browse the repository at this point in the history
added methods to the csharp wrapper
  • Loading branch information
pdugre authored Oct 3, 2019
2 parents e339213 + c4b5ce9 commit 274d165
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion devolutionscrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devolutionscrypto"
version = "0.1.4"
version = "0.1.5"
authors = ["Philippe Dugre <[email protected]>", "Mathieu Morrissette <[email protected]>"]
edition = "2018"
readme = "../README.md"
Expand Down
2 changes: 1 addition & 1 deletion wrappers/csharp/GeneratePackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
dllpath = "./" + folder + "/bin/DevolutionsCrypto-" + arch["name"] + ".dll"

if rdm:
dllpath = "./rdm/bin/" + arch["name"] + "/DevolutionsCrypto-" + arch["name"] + ".dll"
dllpath = "./rdm/bin/" + arch["name"] + "/DevolutionsCrypto.dll"

shutil.copy("../../devolutionscrypto/target/" + arch["value"] + "/release/devolutionscrypto.dll", dllpath)

Expand Down
15 changes: 15 additions & 0 deletions wrappers/csharp/Managed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ namespace Devolutions.Cryptography

public static class Managed
{
public static byte[] DeriveKey(byte[] password, byte[] salt = null, uint iterations = 10000)
{
return Native.DeriveKey(password, salt, iterations);
}

public static byte[] DeriveKey(string password, byte[] salt = null, uint iterations = 10000)
{
return Native.DeriveKey(Utils.StringToByteArray(password), salt, iterations);
}

public static byte[] GenerateKey(uint keySize)
{
return Native.GenerateKey(keySize);
}

/***************************************************************
*
* Encrypt
Expand Down

0 comments on commit 274d165

Please sign in to comment.