GithubHelp home page GithubHelp logo

kennethmyhra / http.encryptedcontentencoding Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.29 MB

Example of Encrypted Content Encoding over HTTP and REST

License: Other

C# 41.51% CSS 0.58% JavaScript 54.62% HTML 3.26% ASP.NET 0.02%
encryption rest

http.encryptedcontentencoding's People

Contributors

dependabot[bot] avatar kennethmyhra avatar

Watchers

 avatar  avatar

http.encryptedcontentencoding's Issues

Not Posting Encrypted Content

return await client.PostAsync(url, content);

Thanks for building this example, it's been really helpful to me but your are not sending encrypted content in the HttpPostEncryptedContentAndReceiveEncryptedResponseAsync method as the name suggests. I think the method should be:

using (var client = new HttpClient())
{
    HttpContent content = new StringContent(data, Encoding.UTF8, contentType);
    var key = KeyLocator(keyId);
    HttpContent encryptedContent = new Aes128GcmEncodedContent(content, key, keyId, 4096);

    client.DefaultRequestHeaders.Add("X-aes128gcm-KeyId", keyId);
    client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("aes128gcm"));
    content.Headers.ContentType = new MediaTypeHeaderValue(contentType);

    return await client.PostAsync(url, encryptedContent);
}

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.