---
title: "Denying your public classes from your end customers"
url: "https://osherove.com/blog/2004/12/29/denying-your-public-classes-from-your-end-customers.md"
canonical: "https://osherove.com/blog/2004/12/29/denying-your-public-classes-from-your-end-customers.html"
published: "2004-12-29T14:43:00"
updated: "2004-12-29T14:43:00"
tags: [".Net Original"]
author: "Roy Osherove"
description: "Here's a cool way to make sure that no one else but your application can use any of the public classes that are exposed by your business assemblies: you put a permission requirement on the class that requires the strong…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Denying your public classes from your end customers

By Roy Osherove December 29, 2004 In [.Net Original](https://osherove.com/blog/category/net-original)

**Historical article** · Originally published December 29, 2004; technical details may be outdated.

Here's a cool way to make sure that no one else but your application can use any of the public classes that are exposed by your business assemblies: you put a permission requirement on the class that requires the strong name of your calling assembly:

\[StrongNameIdentityPermission(SecurityActoin.LinkDemand, PublicKey="XXXYY)\]

public class MyPublicLogicClass

{

//do something

}

\[via [Juval Lowy's](http://www.idesign.net/) .Net Master class\]

## More in .Net Original

[All posts in .Net Original](https://osherove.com/blog/category/net-original)

- Dec 30, 2004

    ### [Next generation iteration: Array.ForEach and Delegate inference](https://osherove.com/blog/2004/12/30/next-generation-iteration-arrayforeach-and-delegate-inferenc.html)

- Dec 29, 2004

    ### [Do not serialize delegates and events blindly](https://osherove.com/blog/2004/12/29/do-not-serialize-delegates-and-events-blindly.html)

- Dec 29, 2004

    ### [Developing as non-admin made easier with VS.Net 2005?](https://osherove.com/blog/2004/12/29/developing-as-non-admin-made-easier-with-vsnet-2005.html)

- Dec 14, 2004

    ### [Session ideas and suggestions for Microsoft Tech-Ed 2005 and future conferences in general](https://osherove.com/blog/2004/12/14/session-ideas-and-suggestions-for-microsoft-tech-ed-2005-and.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
