本文整理汇总了Java中java.security.KeyStore.LoadStoreParameter类的典型用法代码示例。如果您正苦于以下问题:Java LoadStoreParameter类的具体用法?Java LoadStoreParameter怎么用?Java LoadStoreParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadStoreParameter类属于java.security.KeyStore包,在下文中一共展示了LoadStoreParameter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: engineLoad
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
/**
* 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());
}
}
开发者ID:vespa-engine,项目名称:vespa,代码行数:19,代码来源:PemKeyStore.java
示例2: engineLoad
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
@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();
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:24,代码来源:TestKeyStoreSpi.java
示例3: engineStore
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
@Override
public void engineStore(LoadStoreParameter param) throws IOException,
NoSuchAlgorithmException, 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();
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:20,代码来源:TestKeyStoreSpi.java
示例4: engineLoad
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
@Override
public void engineLoad(final LoadStoreParameter param)
throws IOException, NoSuchAlgorithmException, 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();
}
开发者ID:e-Contract,项目名称:commons-eid,代码行数:32,代码来源:BeIDKeyStore.java
示例5: engineStore
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
public void engineStore(LoadStoreParameter param)
throws IOException,
NoSuchAlgorithmException, 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());
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:46,代码来源:PKCS12KeyStoreSpi.java
示例6: engineStore
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
@Override
public void engineStore(LoadStoreParameter param)
throws IOException, NoSuchAlgorithmException, CertificateException {
LOGGER.debug("engineStore");
super.engineStore(param);
}
开发者ID:e-Contract,项目名称:commons-eid,代码行数:7,代码来源:BeIDKeyStore.java
示例7: getLoadStoreParameter
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
public LoadStoreParameter getLoadStoreParameter()
{
return this.loadStoreParameter;
}
开发者ID:CardContact,项目名称:opensc-java,代码行数:5,代码来源:PKCS11RSAKeyPairGenParameterSpec.java
示例8: setLoadStoreParameter
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
public void setLoadStoreParameter(LoadStoreParameter loadStoreParameter)
{
this.loadStoreParameter = loadStoreParameter;
}
开发者ID:CardContact,项目名称:opensc-java,代码行数:5,代码来源:PKCS11RSAKeyPairGenParameterSpec.java
示例9: setLoadStoreParameter
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
/**
* @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);
开发者ID:CardContact,项目名称:opensc-java,代码行数:7,代码来源:PKCS11KeyPairGenParams.java
示例10: getLoadStoreParameter
import java.security.KeyStore.LoadStoreParameter; //导入依赖的package包/类
/**
* @return The optional LoadStoreParameter settings.
*/
LoadStoreParameter getLoadStoreParameter();
开发者ID:CardContact,项目名称:opensc-java,代码行数:5,代码来源:PKCS11KeyPairGenParams.java
注:本文中的java.security.KeyStore.LoadStoreParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论