java.security.NoSuchAlgorithmException: 算法异常的解决方法,亲测有效,嘿嘿嘿

java.security.NoSuchAlgorithmException:Cannot find any provider supporting DES/ECB/PKCS5Padding异常解决 在Spring Tools Suite4运行下面的代码进行des加密时会报下面的异常: java.security.NoSuchAlgorithmException:Cannot find any provider supporting DES/ECB/PKCS5Padding package com.talkweb.unicom.equity.utils; import java.s... 阅读详情
AI摘要

本文探讨了Java中NoSuchAlgorithmException的常见原因,包括算法名称错误、提供者缺失、版本问题和安全策略限制。提供了检查算法、更新Java、添加加密服务提供者和检查安全策略的解决方法,并附有BouncyCastle示例。


java.security.NoSuchAlgorithmException 异常通常表明 Java 运行时环境在尝试实例化一个不存在的加密算法或无法找到该算法的实现时发生了问题。以下是对这个异常的分析、报错原因、解决思路、解决方法,以及代码示例。

问题分析

当在 Java 程序中调用 javax.crypto.Cipher.getInstance(String transformation) 或者 java.security.MessageDigest.getInstance(String algorithm) 等方法时,如果传入的算法名称不存在或者不被当前的 Java 环境支持,就会抛出 NoSuchAlgorithmException。

报错原因

  1. 算法名称错误:你可能在代码中指定了一个不存在的算法名称。
  2. 算法提供者缺失:尽管算法名称是正确的,但 Java 运行时环境中可能缺少支持该算法的提供者(如加密服务提供者 JCE)。
  3. Java 版本问题:某些算法可能在旧版本的 Java 中不可用。
  4. 安全策略限制:Java 的安全策略文件可能限制了某些算法的使用。

解决思路

  1. 检查算法名称:确保你使用的算法名称是正确的,并且与 Java 文档中的描述相匹配。
  2. 更新 Java:如果你使用的是较旧的 Java 版本,尝试升级到最新版本。
  3. 添加加密服务提供者:如果 Java 环境中缺少算法提供者,你可以添加相应的 JCE 库。
  4. 检查安全策略:检查 Java 的安全策略文件,确保没有限制你正在尝试使用的算法。

解决方法

1. 检查算法名称

确保你的算法名称是正确的。例如,对于 AES 加密算法,你可能需要这样调用 Cipher 类:

Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
2. 更新 Java

访问 Oracle 官网或其他 Java 发行版的网站,下载并安装最新版本的 Java。

3. 添加加密服务提供者

如果你使用的是某个特定的加密库(如 Bouncy Castle),你可能需要将其添加到 Java 的类路径中,并在代码中指定它作为提供者。例如:

Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "BC");

注意:你需要添加 Bouncy Castle 的依赖到你的项目中,并导入相应的类。

4. 检查安全策略

如果你怀疑安全策略文件限制了算法的使用,你可以编辑或替换它。但是,请注意,这通常是一个高级操作,需要谨慎处理。

代码示例

下滑查看解决方法

这里是一个使用 Bouncy Castle 作为加密服务提供者的示例:

import org.bouncycastle.jce.provider.BouncyCastleProvider;

import javax.crypto.Cipher;
import java.security.Security;

public class EncryptionExample {
    public static void main(String[] args) throws Exception {
        Security.addProvider(new BouncyCastleProvider());
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "BC");
        // ... 接下来是加密或解密的代码 ...
    }
}

在这个示例中,我们首先添加了 Bouncy Castle 提供者,然后使用它来实例化一个 Cipher 对象。

Caused by: java.security.NoSuchAlgorithmException: PBEWithSHAAndTwofish-CBC SecretKeyFactory not ava 摘要:Linux系统对接中信银行时出现PBEWithSHAAndTwofish-CBC算法不支持问题,主要原因是Bouncy Castle加密提供者验证失败。解决方案包括:1)安装官方签名的Bouncy Castle JAR并配置Java安全策略(推荐);2)动态注册提供者;3)验证JAR签名;4)调整安全策略。系统级修复需检查Java版本、更新CA证书及系统时间。验证步骤包括测试加密操作和检查提供者注册状态,同时需排查多版本冲突、类加载器问题和SELinux限制等常见问题。 阅读详情

相关推荐

解决:java.security.NoSuchAlgorithmException:Cannot find any provider supporting AES/CBC/PKCS7Padding小记

由于开发小程序的需要,需要在后台对微信接口返回的敏感信息加密数据进行解密,以便开发使用,但是,在解密时出现以下异常: java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/PKCS7Padding 网上查找原因,是java原生jdk不支持PKCS7Padding填充方式,解决方式有很...

IT小浣熊的博客 3万+

java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation

JAVA中调用思科的IP电话时 生产环境报异常: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable t...

suzl478068的博客 8517

Java国密算法集成实战:解决NoSuchAlgorithmException与Provider注册

在Java应用开发中,加密算法是保障数据安全的核心技术之一。Java标准加密体系JCE通过安全提供者机制支持多种算法,但默认不包含国密算法。要让Java识别并使用国密SM2/SM3/SM4算法,需要引入并注册实现了国密标准的JCE安全提供者。这一技术方案解决了Java环境中国密算法支持缺失的问题,使得开发者能够在金融、政务等对数据安全有严格要求的场景中合规使用国产密码算法。本文以国密SM4算法为例,详细解析了安全提供者的注册机制、算法名称规范以及加解密实现,帮助开发者快速集成国密算法,避免常见的NoSuch

weixin_33911824的博客 417

java.security.NoSuchAlgorithmException: SHA256WithRSAandMGF1 Signature not available

SHA256WithRSAandMGF1 是 BC Provider 提供的一个签名算法,而 JDK 1.8 的 java.security.* 包中并没有这个 Provider。运行如下代码,可以打印 JDK 中的 Provider 列表,以及所有签名算法。可以看到,BC Provider 已经被添加到列表中,且 SHA256WithRSAandMGF1 算法也在支持的签名算法列表中。再次运行签名方法,异常问题已经被修复,能正确对数据进行签名。笔者在做 RSA 签名时,遇到了一个异常,详见下文。...

长安明月的博客 7776

Java加密算法异常NoSuchAlgorithmException:从Provider机制到实战排查

在Java安全编程中,加密解密功能依赖于Java密码体系(JCE)的服务提供者接口(SPI)机制。其核心原理是,Java运行时通过注册的Provider(如SunJCE、BouncyCastle)来查找和提供具体的算法实现,例如AES或RSA。这一机制的技术价值在于提供了可插拔、标准化的密码服务框架,使得开发者能够灵活使用不同供应商的算法实现。典型的应用场景包括数据加密传输、数字签名和身份验证等安全需求。然而,在实际工程实践中,开发者常会遇到`java.security.NoSuchAlgorithmExc

340

Java安全异常:找不到算法异常

在处理这个异常时,我们需要确认安全提供程序的可用性,确保使用的算法名称正确,并检查Java版本的兼容性。"java.security.NoSuchAlgorithmException"异常通常在尝试使用Java加密体系结构中不存在的算法时引发。加密/解密操作:当尝试对数据进行加密或解密时,如果指定的算法不可用或不受支持,就会抛出该异常。签名/验证操作:在进行数字签名或验证操作时,如果指定的算法不可用,就会引发该异常。安全随机数生成:在生成安全随机数时,如果所请求的算法不可用,就会抛出该异常。

ScriptCharm的博客 2799

已解决java.security.NoSuchAlgorithmException: 没有这样的算法异常的正确解决方法,亲测有效!!!

已解决java.security.NoSuchAlgorithmException: 没有这样的算法异常的正确解决方法,亲测有效!!!

小明的Java问道之路 9109

java.security.DigestException异常的正确解决方法

java.security.DigestException异常的正确解决方法

wbajsjhhhhh的博客 2390

【Java】已解决:java.security.NoSuchAlgorithmException

通常发生在开发者尝试获取某种加密算法实例时,但所请求的算法在当前的Java环境中不存在或不可用。本文将详细分析这一异常的背景、原因、错误与正确的代码示例,并提供相关注意事项,帮助读者快速定位并解决该问题。,我们需要确保算法名称正确无误,并且使用的JDK版本支持所需的加密算法。,编写出更健壮、更可靠的加密相关代码。希望本文能够帮助您理解并解决这一常见的报错问题。在Java开发中,处理加密算法是一个常见的任务,但如果不小心,可能会遇到。算法的实例,如果Java环境中没有支持。算法的实现,则会抛出。

屿小夏.的知识博客 2623

手把手教你搭建日本亚马逊CVV钓鱼系统(含自动验证功能)

本文详细介绍了电商平台安全防护的关键实践,重点讲解了如何构建自动化风控系统。内容包括基础架构设计、用户行为分析、交易风险评估模型构建、验证机制实现以及系统部署优化,帮助电商平台有效识别和防范安全威胁,同时提升用户体验。

weixin_30952535的博客 821

智能车图像处理去畸变+逆透视教程

图像处理,去畸变与逆透视整合

wu58430的博客 1万+

解决Java中的NoSuchAlgorithmException异常的技术实践

异常在Java编程中经常遇到,通常是由于使用了不存在或不可用的加密算法名称导致的。通过使用标准的加密算法名称、检查Java加密提供程序是否可用以及更新Java加密提供程序等方法,可以有效地解决这个异常。希望本文介绍的技术实践能够帮助您更好地处理异常,提高程序的稳定性和可靠性。

微赚开发者技术分享博客 997

SAP PCE 到底有没有 AI 能力:从标准功能、Joule、ABAP 扩展到项目落地的完整解读

摘要:SAP S/4HANA Cloud Private Edition(PCE)已深度集成AI能力,主要体现在三个方面:1)标准业务流程中的AI辅助功能(如财务分录生成、维修单据处理);2)通过Joule提供的自然语言交互入口,支持业务导航和部分事务处理;3)开发者可通过ABAP AI SDK与BTP平台集成实现扩展。PCE不是独立AI平台,企业级自定义AI需结合SAP BTP实现。AI能力已深度融入财务、制造等业务场景,但关键业务仍需人工审核。(149字)

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 345

java security_java.security.NoSuchAlgorithmException

今天遇到一个java的问题:java.security.NoSuchAlgorithmException: EC KeyPairGenerator not availableat java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:176)at testkey.main(testkey.java:18)java.secu...

weixin_30745053的博客 5366

数字信号处理----数字上变频和下变频都FPGA实现

** 数字信号处理基础----信号下变频和解调 一、 任务介绍 数字上变频器(DUC)和数字下变频器(DDC)广泛应用于通信系统,用于信号采样速率的转换。当信号从基带转换至中频( IF )带,需要使用数字上变频器。而数字下变频器是用于将信号从中频( IF )带转换为基带。DUC和DDC通常包括使用混频器进行频率转换,此外还有采样率转换。DUC或DDC的结构主要取决于所需要的转换率。例如,WiMAX (全球互通微波接入)系统典型的转换率为8—10阶。对于如此低的转换率,DUC和DDC只需采用FIR滤波器架构。

Born_toward的博客 3万+

华为od统一考试B卷【单词搜索】C++ 实现

找到它是一个小游戏,你需要在一个矩阵中找到给定的单词。假设给定单词 HELLOWORD,在矩阵中只要能找到 H->E->L->L->O->W->O->R->L->D连成的单词,就算通过。意区分英文字母大小写,并且您只能上下左右行走,不能走回头路。

MISAYAONE的博客 720

java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/PKCS7Padding

这意味着,无论Java的哪个版本,如果需要PKCS7Padding功能,都需要依赖Bouncy Castle库或类似的第三方实现。:如果默认的Java加密提供者不支持你需要的配置,你可以考虑使用第三方加密库,如Bouncy Castle。Bouncy Castle是一个广泛使用的加密库,它提供了广泛的加密算法和模式支持。总的来说,PKCS7Padding 提供了更大的灵活性和兼容性,但可能需要更复杂的实现。:确保你使用的是Java 8的最新更新版本,因为较新的更新可能包含更多的加密提供者。

一个写了10年bug的程序员日常笔记。 2031

vue2 - 实现移动端H5网页调用手机相册选取图片或打开摄像头相机拍照上传,如何在h5网站浏览器中打开本机相册或相机选择相片,H5调用本地相册/相机上传图片详细教程(附图片压缩功能及上传服务器示例)

vue2手机H5网页,调起安卓苹果ios手机相册和相机,H5实现调用手机摄像头相册实现图片压缩预览删除,vue项目调用摄像头和相册,H5调用手机摄像头,实时拍照上传,VUE2 H5页面如何唤起手机摄像头拍照上传,H5调起手机端的摄像头,html5调用手机摄像头,实现H5调起手机相机和相册,vue H5拍照上传,手机网站浏览器移动端调取相机或相册,实现拍照上传功能,解决苹果ios手机无法打开相册相机问题,无法唤起摄像头怎么办,调取本机系统的相册,vue h5网页调用相机拍照和相册,实现多张图片上传功能,图片压

✅ 精选推荐文章 1万+

JAVA加密解密异常之java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/PKCS7

JAVA加密解密异常之java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/PKCS7 网上最接近的解决办法: 然并卵。 最后解决办法: 1.在jdk中的jre\lib\security修改java.security文件,替换security.provider.7=o...

zhpeng289的博客 7957

【Davinci开发】:MPU(内存保护)

【Davinci开发】:MPU(内存保护)

2214

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

java.security.NoSuchAlgorithmException解决方案

在linux环境下java程序运行抛出如下异常: java.security.NoSuchAlgorithmException: Cannot find any provider supporting DESede at javax.crypto.Cipher.getInstance(DashoA13*..) at com.newheight.util.Enc...

蝈蝈的技术博客 1万+

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available

2022-09-27 17:55:40.351 ERROR [] [] [] org.springframework.web.context.ContextLoader - Context initialization failed org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not av

qq_43050077的博客 2054

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

java.security.NoSuchAlgorithmException

产出密钥时经常会出现java.security.NoSuchAlgorithmException异常。如下面代码,在elipse中编译通过,但运行时会抛出java.security.NoSuchAlgorithmException异常 KeyGenerator keyGen=null; keyGen = KeyGenerator.getInstance("DES"); keyGen.i...

什么coding都是浮云 3302

java.security_Java开发网 - java.security.NoSuchAlgorithmException 问题的一些解决

Posted by:anrayPosted on:2004-12-08 14:32产出密钥时经常会出现java.security.NoSuchAlgorithmException异常。如下面代码,在elipse中编译通过,但运行时会抛出java.security.NoSuchAlgorithmException异常KeyGenerator keyGen=null;keyGen = KeyGener...

weixin_35160622的博客 7155

[测试]java.security.NoSuchAlgorithmException HmacSHA256 not available.

最近遇到java.security.NoSuchAlgorithmException: Algorithm HmacSHA256 not available.这个问题,在网上搜了半天,都说是jre的问题,但是之前没出现过这种问题的,弄了半天也没解决。后来突然想到自己之前改了eclipse一个地方,之前把这个地址改成了C:\Program Files\Java\jdk1.8.0_05,现在改回C:\...

Freya0110的博客 7598
上一篇: 亲测有效java.io.InvalidClassException: 无效的类异常的解决方法,嘿嘿嘿
下一篇: java.time.format.DateTimeParseException: 日期时间解析异常的解决方法,亲测有效,嘿嘿嘿,已解决
代码无疆
博客等级 码龄3年 4万+粉丝 305原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址