Comments (6)
When you mean via an extension method
, do you mean something like this?
pgp.EncryptionKeys.UseEncryptionKey(_key_to_use_);
pgp.Encrypt(....); // uses _key_to_use_ if available
Out of curiosity, why do you want to avoid additional parameters?
from pgpcore.
Yep, that's exactly what I mean :)
I've seen too much code where people just keep adding method parameters so it just gets a bit out of control which biases me against doing it this way.
Doing this on the EncryptionKeys object means that it'll apply to all subsequent calls made to the PGP object without having to specify it each method call. Not sure if this is a good thing or not but maybe we'd want to set it on EncryptionKeys and then allow it to be changed at the method level.
Essentially I don't know what the best solution for this is but if you've got a preferred solution feel free to put in a PR for it and I'll probably go with it :)
from pgpcore.
Alright! I'll try the method you mentioned and see where we get from there.
One more question though: currently, EncryptionKeys
has lists of encrypt keys, verification keys, etc. This is currently a collection of keys combined from multiple public key rings.
Does it make sense to have multiple public key rings within one EncryptionKeys
object? (I'm still new to Pgp, so I'm not sure).
In the current implementation, users can add multiple public key rings, but I'm not sure what the use case is for that?
from pgpcore.
I've been looking into it a bit more. You can pass multiple public keys/rings so you can encrypt the message for multiple recipients, right? Does this mean the user should be able to specify which key to use per key ring/recipient?
from pgpcore.
PGP command line allows you to specify which key to use in the keyring by passing the KeyID.
from pgpcore.
Hi @MB34
This issue makes sure you can also specify which key to use through code with PGPCore.
from pgpcore.
Related Issues (20)
- Nuget publishing? HOT 1
- SignStreamAsync without armor results in closed outputstream HOT 1
- Does this library support Ascii Armor? If so, please provide a sample code HOT 1
- Getting error with Verify HOT 1
- 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
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.