SecurityCoder.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * FileName:SecurityCoder.java
  3. * <p>
  4. * Copyright (c) 2017-2020, <a href="http://www.webcsn.com">hermit (794890569@qq.com)</a>.
  5. * <p>
  6. * Licensed under the GNU General Public License, Version 3 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. * <p>
  10. * http://www.gnu.org/licenses/gpl-3.0.html
  11. * <p>
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. */
  19. package cn.com.lzt.common.util.security;
  20. import java.security.Security;
  21. /**
  22. * 加密基类
  23. *
  24. * @author ShenHuaJie
  25. * @version 1.0
  26. * @since 1.0
  27. */
  28. public abstract class SecurityCoder {
  29. private static Byte ADDFLAG = 0;
  30. static {
  31. if (ADDFLAG == 0) {
  32. // 加入BouncyCastleProvider支持
  33. Security.addProvider(new BouncyCastleProvider());
  34. ADDFLAG = 1;
  35. }
  36. }
  37. }