微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java.security.KeyStore.LoadStoreParameter的实例源码

项目:vespa    文件PemKeyStore.java   
/**
 * The user is responsible for closing any readers given in the parameter.
 */
@Override
public synchronized void engineLoad(LoadStoreParameter parameter) throws IOException {
    if (storeRole != null)
        throw new IllegalStateException("Already initialized.");

    if (parameter instanceof KeyStoreLoadParameter) {
        storeRole = new KeyStoreRole();
        loadKeyStore((KeyStoreLoadParameter) parameter);
    } else if (parameter instanceof TrustStoreLoadParameter) {
        storeRole = new TrustStoreRole();
        loadTrustStore((TrustStoreLoadParameter) parameter);
    } else {
        throw new IllegalArgumentException("Expected key store or trust store load parameter,got " + parameter.getClass());
    }
}
项目:In-the-Box-Fork    文件TestKeyStoreSpi.java   
@Override
public void engineLoad(LoadStoreParameter param) throws IOException,NoSuchAlgorithmException,CertificateException {
    if (param == null) {
        engineLoad(null,null);
        return;
    }

    ProtectionParameter pParam = param.getProtectionParameter();
    if (pParam == null) {
        throw new NoSuchAlgorithmException();
    }

    if (pParam instanceof PasswordProtection) {
        char[] password = ((PasswordProtection) pParam).getpassword();
        if (password == null) {
            throw new NoSuchAlgorithmException();
        } else {
            return;
        }
    }
    throw new CertificateException();
}
项目:In-the-Box-Fork    文件TestKeyStoreSpi.java   
@Override
public void enginestore(LoadStoreParameter param) throws IOException,CertificateException {
    if (param == null) {
        throw new IOException();
    }

    ProtectionParameter pParam = param.getProtectionParameter();
    if (pParam instanceof PasswordProtection) {
        char[] password = ((PasswordProtection) pParam).getpassword();
        if (password == null) {
            throw new NoSuchAlgorithmException();
        } else if (password.length == 0) {
            throw new CertificateException();
        }
        return;
    }
    throw new UnsupportedOperationException();
}
项目:commons-eid    文件BeIDKeyStore.java   
@Override
public void engineLoad(final LoadStoreParameter param)
        throws IOException,CertificateException {
    LOGGER.debug("engineLoad"); /*
                                 * Allows for a KeyStore to be re-loaded
                                 * several times.
                                 */
    this.beIDCard = null;
    this.authnCertificateChain = null;
    this.signCertificateChain = null;
    this.rrnCertificateChain = null;
    this.authnCertificate = null;
    this.signCertificate = null;
    this.citizenCaCertificate = null;
    this.rootCaCertificate = null;
    this.rrnCertificate = null;
    if (null == param) {
        return;
    }
    if (param instanceof BeIDKeyStoreParameter) {
        this.keyStoreParameter = (BeIDKeyStoreParameter) param;
        return;
    }
    if (param instanceof JFrame) {
        this.keyStoreParameter = new BeIDKeyStoreParameter();
        JFrame frame = (JFrame) param;
        this.keyStoreParameter.setParentComponent(frame);
        return;
    }
    throw new NoSuchAlgorithmException();
}
项目:Aki-SSL    文件PKCS12KeyStoreSpi.java   
public void enginestore(LoadStoreParameter param)
    throws IOException,CertificateException
{
    if (param == null)
    {
        throw new IllegalArgumentException("'param' arg cannot be null");
    }

    if (!(param instanceof PKCS12StoreParameter || param instanceof JDKPKCS12StoreParameter))
    {
        throw new IllegalArgumentException(
            "No support for 'param' of type " + param.getClass().getName());
    }

    PKCS12StoreParameter bcParam;

    if (param instanceof PKCS12StoreParameter)
    {
        bcParam = (PKCS12StoreParameter)param;
    }
    else
    {
        bcParam = new PKCS12StoreParameter(((JDKPKCS12StoreParameter)param).getoutputStream(),param.getProtectionParameter(),((JDKPKCS12StoreParameter)param).isUseDEREncoding());
    }

    char[] password;
    ProtectionParameter protParam = param.getProtectionParameter();
    if (protParam == null)
    {
        password = null;
    }
    else if (protParam instanceof KeyStore.PasswordProtection)
    {
        password = ((KeyStore.PasswordProtection)protParam).getpassword();
    }
    else
    {
        throw new IllegalArgumentException(
            "No support for protection parameter of type " + protParam.getClass().getName());
    }

    doStore(bcParam.getoutputStream(),password,bcParam.isForDEREncoding());
}
项目:commons-eid    文件BeIDKeyStore.java   
@Override
public void enginestore(LoadStoreParameter param)
        throws IOException,CertificateException {
    LOGGER.debug("enginestore");
    super.enginestore(param);
}
项目:opensc-java    文件PKCS11RSAKeyPairGenParameterSpec.java   
public LoadStoreParameter getLoadStoreParameter()
{
    return this.loadStoreParameter;
}
项目:opensc-java    文件PKCS11RSAKeyPairGenParameterSpec.java   
public void setLoadStoreParameter(LoadStoreParameter loadStoreParameter)
{
    this.loadStoreParameter = loadStoreParameter;
}
项目:opensc-java    文件PKCS11DSAKeyPairGenParameterSpec.java   
public LoadStoreParameter getLoadStoreParameter()
{
    return this.loadStoreParameter;
}
项目:opensc-java    文件PKCS11DSAKeyPairGenParameterSpec.java   
public void setLoadStoreParameter(LoadStoreParameter loadStoreParameter)
{
    this.loadStoreParameter = loadStoreParameter;
}
项目:RipplePower    文件PKCS12KeyStoreSpi.java   
public void enginestore(LoadStoreParameter param)
    throws IOException,bcParam.isForDEREncoding());
}
项目:ripple-lib-java    文件PKCS12KeyStoreSpi.java   
public void enginestore(LoadStoreParameter param)
    throws IOException,bcParam.isForDEREncoding());
}
项目:opensc-java    文件PKCS11KeyPairGenParams.java   
/**
 * @param loadStoreParameter An optional {@link LoadStoreParameter} setting for
 *             opening a PKCS11 session in contexts,which require opening
 *             a new session is required.
 */
void setLoadStoreParameter(LoadStoreParameter loadStoreParameter);
项目:opensc-java    文件PKCS11KeyPairGenParams.java   
/**
 * @return The optional LoadStoreParameter settings.
 */
LoadStoreParameter getLoadStoreParameter();

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。