# SAML2 using encryption

**URL:** <https://devforum.okta.com/t/saml2-using-encryption/16278>\
**Category:** SAML\
**Created:** [September 22, 2021, 3:47pm UTC](https://devforum.okta.com/t/saml2-using-encryption/16278 "2021-09-22T15:47:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaron-h](https://avatars.discourse-cdn.com/v4/letter/y/e47c2d/32.png) [@yaron-h](https://devforum.okta.com/u/yaron-h)\
**Post date:** [September 22, 2021, 3:47pm UTC](https://devforum.okta.com/t/saml2-using-encryption/16278/1 "2021-09-22T15:47:47Z")

</div>

hi  
i follow the [Nick Gamb](https://developer.okta.com/blog/authors/nick-gamb/) blog at

> **[How to Authenticate with SAML in ASP.NET Core and C#](https://developer.okta.com/blog/2020/10/23/how-to-authenticate-with-saml-in-aspnet-core-and-csharp)**
>
> Learn how to authenticate with SAML in ASP.NET Core and C#.

very good, but my needs are to add encryption for SAML request and decrypt the SAML respond  
the project ITfoxtec.Identity.Saml2, dose have a support for Encryption, but it is not clear how to use it (no sample code)  
can Nick provide a sample ?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 6:59pm UTC](https://devforum.okta.com/t/saml2-using-encryption/16278/2 "2024-02-12T18:59:01Z")

</div>

Closed on February 12, 2024, 6:59pm UTC


