在唯一密钥属性“value”设置为“default.aspx”(或者index.asp等)时,无法添加类型为“add”的重复集合项

在唯一密钥属性“value”设置为“index.php”(或者index.asp等)时,无法添加类型为“add”的重复集合项

IIS服务器添加网站后提示在唯一密钥属性“value”设置为“index.php”(或者index.asp等)时,无法添加类型为“add”的重复集合项

找到网站当前目录->web.config文件

在flies标签中添加 

<clear />

<add value="index.php" />    
                <add value="Default.htm" />    
                <add value="index.htm" />    
                <add value="index.html" />   
                <add value="iisstart.htm" />
                <add value="default.aspx" />


例如:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
            <clear />
                <add value="index.php" />    
                <add value="Default.htm" />    
                <add value="index.htm" />    
                <add value="index.html" />   
                <add value="iisstart.htm" />
                <add value="default.aspx" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

即可

  • 5
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
可以使用Bouncy Castle等第三方库来将PEM格式的EC私钥转换为`java.security.interfaces.ECPrivateKey`对象,示例代码如下: ```java import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.security.Security; import java.security.interfaces.ECPrivateKey; import java.security.spec.PKCS8EncodedKeySpec; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.openssl.PEMKeyPair; import org.bouncycastle.openssl.PEMParser; import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; public class PemToECPrivateKey { public static ECPrivateKey convert(File pemFile, String password) throws Exception { Security.addProvider(new BouncyCastleProvider()); PEMParser pemParser = new PEMParser(Files.newBufferedReader(pemFile.toPath(), StandardCharsets.UTF_8)); Object object = pemParser.readObject(); pemParser.close(); PEMKeyPair keyPair; if (object instanceof PEMKeyPair) { keyPair = (PEMKeyPair) object; } else { throw new IOException("Invalid PEM file: " + pemFile); } PKCS8EncodedKeySpec keySpec; if (password != null && !password.isEmpty()) { keySpec = keyPair.decryptKeyPair(password.toCharArray()).getPrivate().getEncoded(); } else { keySpec = keyPair.getPrivateKeyInfo().getEncoded(); } JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC"); return (ECPrivateKey) converter.getPrivateKey(keySpec); } } ``` 上述代码中,`pemFile`参数是一个PEM格式的密钥文件,`password`参数是密码(如果有的话)。首先需要添加Bouncy Castle提供的安全提供程序。然后使用PEMParser对象读取PEM格式的密钥文件,解析出PEMKeyPair对象。如果密钥文件有密码,需要使用`decryptKeyPair()`方法解密密钥对。然后使用JcaPEMKeyConverter对象将PKCS#8格式的EC私钥规范转换为`java.security.interfaces.ECPrivateKey`对象。最后返回ECPrivateKey对象即可。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值