skip to Main Content

Can't load generated public key from NodeJS into Windows via CNG APIs – Javascript

I generate RSA public/private key pairs in NodeJS using crypto library: crypto.generateKeyPair( "rsa", { modulusLength: 1024, publicKeyEncoding: { type: "pkcs1", format: "pem", }, privateKeyEncoding: { type: "pkcs1", format: "pem", }, }, (err, publicKey, privateKey) => { fs.writeFileSync("/home/dev/priv.pem", privateKey); fs.writeFileSync("/home/dev/pub.pem", publicKey);…

VIEW QUESTION

How do you properly deserialize a class that has an IReadOnlyCollection<T> using System.Text.Json?

I have the following class: public sealed class SomeClass { [JsonConstructor()] public SomeClass(IEnumerable<string> myItems) { InternalMyItems = new Collection<string>(myItems.ToArray()); MyItems = new ReadOnlyCollection<string>(InternalMyItems); } public IReadOnlyCollection<string> MyItems { get; } private Collection<string> InternalMyItems { get; } } Serialization seems to…

VIEW QUESTION
Back To Top
Search