本文整理汇总了Java中javax.net.ssl.ManagerFactoryParameters类的典型用法代码示例。如果您正苦于以下问题:Java ManagerFactoryParameters类的具体用法?Java ManagerFactoryParameters怎么用?Java ManagerFactoryParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagerFactoryParameters类属于javax.net.ssl包,在下文中一共展示了ManagerFactoryParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
throws InvalidAlgorithmParameterException
{
if (params instanceof StaticTrustAnchors)
{
current = new Manager(((StaticTrustAnchors) params).getCertificates());
}
else if (params instanceof NullManagerParameters)
{
current = new Manager(new X509Certificate[0]);
}
else
{
throw new InvalidAlgorithmParameterException();
}
}
示例2: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Incorrect parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore(),
((Parameters)spec).getPassword());
} catch (Exception e) {
throw new InvalidAlgorithmParameterException(e.toString());
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}
}
示例3: testKeyManagerFactory12
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
* Test for <code>init(ManagerFactoryParameters params)</code>
* Assertion:
* throws InvalidAlgorithmParameterException when params is null
*/
public void testKeyManagerFactory12() throws NoSuchAlgorithmException {
if (!DEFSupported) {
fail(NotSupportedMsg);
return;
}
ManagerFactoryParameters par = null;
KeyManagerFactory[] keyMF = createKMFac();
assertNotNull("KeyManagerFactory object were not created", keyMF);
for (int i = 0; i < keyMF.length; i++) {
try {
keyMF[i].init(par);
fail("InvalidAlgorithmParameterException must be thrown");
} catch (InvalidAlgorithmParameterException e) {
}
}
}
示例4: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Null parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore());
} catch (KeyStoreException e) {
throw new RuntimeException(e);
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}
}
示例5: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Incorrect parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore(),
((Parameters)spec).getPassword());
} catch (Exception e) {
throw new InvalidAlgorithmParameterException(e.toString());
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}
}
示例6: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Incorrect parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore(),
((Parameters)spec).getPassword());
} catch (Exception e) {
throw new InvalidAlgorithmParameterException(e.toString());
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}
}
示例7: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
* @see javax.net.ssl#engineInit(ManagerFactoryParameters)
*/
@Override
public void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
throw new InvalidAlgorithmParameterException(
"ManagerFactoryParameters not supported");
}
示例8: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
* @see KeyManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
*/
@Override
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
throw new InvalidAlgorithmParameterException(
"ManagerFactoryParameters not supported");
}
示例9: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
* Initializes key manager with a special parameter object, which may contain revalidation time
*
* @param params must be instance of ExpiringCacheKeyManagerParameters
* @throws InvalidAlgorithmParameterException if params is not correct type
*/
@Override
protected void engineInit(ManagerFactoryParameters params) throws InvalidAlgorithmParameterException {
if (params instanceof ExpiringCacheKeyManagerParameters == false)
throw new InvalidAlgorithmParameterException("Parameters must be instance of ExpiringCacheKeyManagerParameters");
ExpiringCacheKeyManagerParameters inParams = (ExpiringCacheKeyManagerParameters)params;
if (inParams.getCacheRevalidation() < 5)
throw new InvalidAlgorithmParameterException("Cache expiration time must be at least 5 seconds");
try {
keyManager = new ExpiringCacheKeyManager(inParams);
}
catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
throw new InvalidAlgorithmParameterException(e);
}
}
示例10: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
throws InvalidAlgorithmParameterException
{
if (params instanceof NullManagerParameters)
{
current = new Manager(Collections.EMPTY_MAP, Collections.EMPTY_MAP);
}
else if (params instanceof PrivateCredentials)
{
List<X509Certificate[]> chains
= ((PrivateCredentials) params).getCertChains();
List<PrivateKey> keys
= ((PrivateCredentials) params).getPrivateKeys();
int i = 0;
HashMap<String, X509Certificate[]> certMap
= new HashMap<String, X509Certificate[]>();
HashMap<String, PrivateKey> keyMap
= new HashMap<String, PrivateKey>();
Iterator<X509Certificate[]> c = chains.iterator();
Iterator<PrivateKey> k = keys.iterator();
while (c.hasNext() && k.hasNext())
{
certMap.put(String.valueOf(i), c.next());
keyMap.put(String.valueOf(i), k.next());
i++;
}
current = new Manager(keyMap, certMap);
}
else
{
throw new InvalidAlgorithmParameterException();
}
}
示例11: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
throws InvalidAlgorithmParameterException
{
if (params == null)
{
try
{
String srpPasswd = Util.getSecurityProperty("jessie.srp.password.file");
if (srpPasswd == null)
{
current = new Manager(new PasswordFile());
return;
}
String srpPasswd2 = Util.getSecurityProperty("jessie.srp.password.file2");
if (srpPasswd2 == null)
srpPasswd2 = srpPasswd + "2";
String srpConfig = Util.getSecurityProperty("jessie.srp.config");
if (srpConfig == null)
srpConfig = srpPasswd + ".conf";
current = new Manager(new PasswordFile(srpPasswd, srpPasswd2, srpConfig));
return;
}
catch (IOException ioe)
{
throw new InvalidAlgorithmParameterException("default initialization failed: "
+ ioe.toString());
}
}
if (params instanceof SRPManagerParameters)
{
current = new Manager(((SRPManagerParameters) params).getPasswordFile());
return;
}
throw new InvalidAlgorithmParameterException();
}
示例12: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(final ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException {
LOGGER.debug("engineInit(spec)");
if (null == spec) {
return;
}
if (false == spec instanceof BeIDManagerFactoryParameters) {
throw new InvalidAlgorithmParameterException();
}
this.beIDSpec = (BeIDManagerFactoryParameters) spec;
}
示例13: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Null parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore());
} catch (KeyStoreException e) {
throw new RuntimeException(e);
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}
}
示例14: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
public void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
if (spec == null) {
throw new InvalidAlgorithmParameterException("Incorrect parameter");
}
isInitialized = true;
}
示例15: engineInit
import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
* @see javax.net.ssl.KeyManagerFactorySpi#engineInit(ManagerFactoryParameters
* spec)
*/
@Override
public void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException {
throw new InvalidAlgorithmParameterException(
"ManagerFactoryParameters not supported");
}