Java认证库
我正在开发一个服务器/客户端Java应用程序,我需要在发送数据之前对客户端进行身份验证,还需要在身份验证后对发送的数据进行加密并确保其新鲜度,
我想知道我可以用来做到这一点的最佳库是什么?
I am developing a server/client Java application where I need to authenticate the client before sending data, also I need to encrypt the sent data after authentication and to ensure its freshness
I am wondering what is the best library that I could use to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
查看 Spring 框架 中的安全模块。几乎涵盖了所有常见的身份验证和授权服务
Take a look at the security module in the Spring framework. Pretty much covers all the common authentication and authorisation services
Java 身份验证和授权服务 是一个自 SE 1.4 起成为 Java 规范的一部分。 API 的定义相当明确,但由于它的编写目标是覆盖所有可能的身份验证后端(包括 LDAP、智能卡和类似的东西),因此可能会带来太多的功能开销。
Apache Shiro 是我所知道的库/框架之一,它构建在 JAAS 之上,抽象了它的概念并使得它们通常更容易使用。第二个是 jGuard,但截至 2013 年 12 月,似乎没有不再维护。
Java Authentication and Authorization Service is a part of Java spec since SE 1.4. The API is fairly well-defined, but as it has been written with goal of covering every possible auth backend (including LDAP, smart card and similar stuff) it may bring too much functionality overhead.
Apache Shiro is one of libraries/frameworks that I am aware of, that build upon JAAS, abstracting it's concepts and making them generally easier to use. The second one is jGuard, but as of Dec 2013 it seems to not being maintained anymore.
您可以使用 OpenLDAP ( http://www.openldap.org/ jldap/)。
You could integrate with an existing LDAP (or Active Directory) registry using OpenLDAP ( http://www.openldap.org/jldap/ ).
您可以使用公钥加密并基于证书进行客户端身份验证。
查看 SUN 的 JSSE on secure插座
You could use Public Key Encryption and do client authentication based on certificates.
Check out JSSE of SUN on secure sockets
如果您没有使用 Spring 并且正在使用一些现成的服务器框架,请查看那里 - 大多数都包含授权模块。
If you are not using Spring and you are using some off-the-shelf server framework, look there - most include authorization modules.