我使用 OpenSSL 创建了一个自签名证书,如下所示:
openssl req -x509 -sha512 -new keyrsa:2048 -keyout key2.pem -out cert2.pem -days 100
openssl pkcs12 -export -out pkcs12_cert_test2.pfx -inkey key2.pem -in cert2.pem
我已经安装pkcs12_cert_test2.pfx在 Windows 上,证书签名算法值为sha512RSA
然后,我在 C# .NET 4.0 中编写了以下代码:
public static bool DSHandler(string operation, string path, string devicePath)
{
bool result = false;
CryptoConfig.AddAlgorithm(typeof(USBSaferAppEFB.RsaPkCs1Sha512SignatureDescription),
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512");
string password = "xxxx";
bool validSignature = false;
byte[] hashchain = generateHash(path);
string digSignFile = Utils.RegVarValue(DIGSIGNFILE);
string subjectDN = Utils.RegVarValue(SUBJECTDN);
if (operation == "sign")
{
byte[] signature = SignFromContainer(hashchain, …Run Code Online (Sandbox Code Playgroud) 我想在单击提交按钮时显示一些带有一些inputText字段的requiredMessages的弹出窗口.但只是在有这些消息的情况下.我已经在oncomplete标签上尝试使用bean变量和javascript,但我无法使其正常工作.如果我在p:对话框中输入visible ="true",则会始终显示弹出窗口,但我尝试从commandButton控制它.现在,我有这个,但弹出窗口永远不会显示:
<h:inputText id="Scheme"
required="true"
requiredMessage="Required.">
</h:inputText>
<h:commandButton id="submitModify" value="#{msg['systemdetail.modify']}"
action="#{sistem.modify}"
oncomplete="if (#{facesContext.maximumSeverity != null}) {dlg1.show();}">
</h:commandButton>
<p:dialog id="popup"
style="text-align:center"
widgetVar="dlg1"
modal="true">
<h:messages layout="table"/>
</p:dialog>
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?提前致谢.