windows下运行macInstance = Mac.getInstance("HmacSHA1");完全正常,Linux下则出现异常:

java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
at javax.crypto.Mac.getInstance(DashoA13*..);
主要原因是linux下缺少依赖包。
解决方法:
    在windows下打开目录$JAVA_HOME/jre/lib/ext/,找到sunjce_provider.jar,然后拷贝至linux下对应的目录即可。 可参考:http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html

解决:NoSuchAlgorithmException: Algorithm HmacSHA1 not available的更多相关文章

  1. TOTP:Time-based One-time Password Algorithm(基于时间的一次性密码算法)

    TOTP:Time-based One-time Password Algorithm(基于时间的一次性密码算法) TOTP - Time-based One-time Password Algori ...

  2. 一段JAVA签名算法的PHP改写

    源代码是这样的: public class AuthorizationSignature { public static String createSignature(String verb, Str ...

  3. kong插件应用

    插件概述 插件之于kong,就像Spring中的aop功能.在请求到达kong之后,转发给后端应用之前,你可以应用kong自带的插件对请求进行处理,合法认证,限流控制,黑白名单校验,日志采集等等.同时 ...

  4. 阿里云视频直播API签名机制源码

    阿里云视频直播API签名机制源码 本文展示:通过代码实现下阿里视频直播签名处理规则 阿里云视频直播签名机制,官方文档链接:https://help.aliyun.com/document_detail ...

  5. Spark记录-官网学习配置篇(一)

    参考http://spark.apache.org/docs/latest/configuration.html Spark提供三个位置来配置系统: Spark属性控制大多数应用程序参数,可以使用Sp ...

  6. Spring boot 集成 阿里 Mqtt

    因为公司业务需求,需要接入 阿里Mqtt,自己基于Spring写了一个小demo,记录下来,已备以后需要. 第一步 创建一个实体bean用来装载 MqttClient private MqttClie ...

  7. TOTP算法 基于时间的一次性密码

    /** Copyright (c) 2011 IETF Trust and the persons identified as authors of the code. All rights rese ...

  8. springboot操作mongodb

    springboot操作mongodb 采用MongoRepository操作mongodb springboot版本2.1.2.RELEASE 注意的是:在运行应用程序时,会报错OSS Algori ...

  9. Spark Programming--- Shuffle operations

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

随机推荐

  1. 组合or继承

    面向对象设计有一个原则“优先使用对象组合,而不是继承”. 下面是两者优缺点的比较: 组 合 关 系 继 承 关 系 优点:不破坏封装,整体类与局部类之间松耦合,彼此相对独立 缺点:破坏封装,子类与父类 ...

  2. reverse engineering in ax

    install Visio2010 Premium(UML model template). not work in Visio 2013 and other version.

  3. php使用mysql和mysqli连接查询数据

    mysql: <?php $code = $_POST['code']; $status = ""; $success = ""; $scookies = ...

  4. gulp使用笔记

    gulp简介 gulp 是基于 Nodejs 的自动任务运行器,能自动化地完成javascript/coffee/sass/less/html/image/css等文件的的测试.检查.合并.压缩.格式 ...

  5. 最新原创:Power8伴随云计算横空出世

    Power8伴随云计算横空出世 自从IBM将并不赚钱的x86服务器业务转手给联想之后,从此IBM便开始了硬件转型的新里程碑.伴随此事继续发酵的还有Power System Linux落户北京,从此IB ...

  6. neutron debug

    neutron port-list neutron port-delete neutron floatingip-list neutron floatingip-delete

  7. 17.linux下root用户与普通用户

    默认安装完成之后并不知道root用户的密码,那么如何应用root权限呢? (1)sudo 命令   这样输入当前管理员用户密码就可以得到超级用户的权限.但默认的情况下5分钟root权限就失效了. (2 ...

  8. mybatis - resultMap

    resultMap有比较强大的自动映射,下面是摘自mybatis中文官网的的片段: 当自动映射查询结果时,MyBatis会获取sql返回的列名并在java类中查找相同名字的属性(忽略大小写). 这意味 ...

  9. grep sed 大批量替换字符串

    sed -i s/"str1"/"str2"/g `grep "str1" -rl --include="*.[ch]" ...

  10. 针对bootstrap内联单选框input与文字不能居中对齐的解决办法

    1.html代码 <div > <label class="checkbox-inline first-label"> <input type=&qu ...