Comments (3)
Hi,
Does it work if you follow the code example in the readme?
https://github.com/mattosaurus/PgpCore#signstreamasync
If not it might be a bug. I'm on holiday at the moment but can take a look at it in a couple of weeks if so.
from pgpcore.
Hi,
Thanks for the quick response during your holiday!
Yes, I used that example as a starting point.
But for now have a nice time!
from pgpcore.
Hi, without seeing the rest of your code I'm not sure what the issue might be but the below works for me that's based on your code.
internal class Program
{
static void Main(string[] args)
{
try
{
MainAsync(args).GetAwaiter().GetResult();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
static async Task MainAsync(string[] args)
{
string inputFilePath = @"C:\TEMP\Content\content.txt";
string publicKeyFilePath = @"C:\Temp\public.asc";
string privateKeyFilePath = @"C:\Temp\private.asc";
string passPhrase = "password";
PGP pgpKeys = new PGP();
await pgpKeys.GenerateKeyAsync(publicKeyFilePath, privateKeyFilePath, password: passPhrase);
EncryptionKeys encryptionKeys;
using (Stream privateKeyStream = new MemoryStream(Encoding.UTF8.GetBytes(File.ReadAllText(privateKeyFilePath))))
{
encryptionKeys = new EncryptionKeys(privateKeyStream, passPhrase);
}
var pgp = new PGP(encryptionKeys);
using (Stream inputFileStream = new MemoryStream(Encoding.UTF8.GetBytes(File.ReadAllText(inputFilePath))))
using (Stream outputFileStream = new MemoryStream())
{
await pgp.SignStreamAsync(inputFileStream, outputFileStream);
}
}
}
If you can share a full example of you're non-working code I'll take a look in more detail.
from pgpcore.
Related Issues (20)
- SonarQube scanner java error HOT 1
- PGPCore Error: Org.BouncyCastle.Bcpg.OpenPgp.PgpSecretKeyRing found where PgpPublicKeyRing expected HOT 1
- Verified file has extra characters. HOT 10
- error in BouncyCastle.Utilities.Strings.ToUtf8ByteArray HOT 5
- hash algorithm constant mismatch with bouncy castle when sign
- Generate Key example command doesn't work as provided
- Verify methods should also verify clear signed files
- Add a dethatched sign method
- Add multiple Private Keys to Encryption keys HOT 11
- DecryptStream is very slow HOT 1
- Provide FileName associated with the encrypted data stream HOT 1
- Cannot select non-default PublicKeyAlgorithmTag HOT 2
- VerifyClearAsync string,string overload does not update output variable HOT 2
- Support Network stream HOT 3
- Could not find any signing keys in keyring HOT 2
- Publish latest release to NuGet HOT 2
- Decrypting zero-byte files HOT 2
- Cant decrypt file from third party HOT 2
- Decret symmetric encrypted GPG file HOT 1
- Decrypting PGP with Private Key and no password HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgpcore.