Package java.security

Examples of java.security.KeyStoreException


      String alias = (String) aliasesEnum.nextElement();
      setCurrentAlias(alias);
      return;
    }

    throw new KeyStoreException("The keystore is empty or invalid certificate found!");
  }
View Full Code Here


      pkcs11Provider = (Provider) pkcs11Constr.newInstance(confStream);
      Security.addProvider(pkcs11Provider);
    }
    catch(Exception e)
    {
      throw new KeyStoreException("Cant initialize "
         + "Sun PKCS#11 security provider. Reason: " + e.getCause().getMessage(), e);
    }

    // estrae il keystore dalla smartcard
    KeyStore keyStore = KeyStore.getInstance(CryptoBaseEngine.PKCS11_KEYSTORE_TYPE);
View Full Code Here

    {
        Object  entry = table.get(alias);

        if (entry == null)
        {
            throw new KeyStoreException("no such entry as " + alias);
        }

        table.remove(alias);
    }
View Full Code Here

    {
        StoreEntry  entry = (StoreEntry)table.get(alias);

        if (entry != null && entry.getType() != CERTIFICATE)
        {
            throw new KeyStoreException("key store already has a key entry with alias " + alias);
        }

        table.put(alias, new StoreEntry(alias, cert));
    }
View Full Code Here

        Certificate[]   chain)
        throws KeyStoreException
    {
        if ((key instanceof PrivateKey) && (chain == null))
        {
            throw new KeyStoreException("no certificate chain for private key");
        }

        try
        {
            table.put(alias, new StoreEntry(alias, key, password, chain));
        }
        catch (Exception e)
        {
            throw new KeyStoreException(e.toString());
        }
    }
View Full Code Here

            }
        }

        if (c == null && k == null)
        {
            throw new KeyStoreException("no such entry as " + alias);
        }
    }
View Full Code Here

        Certificate cert)
        throws KeyStoreException
    {
        if (keys.get(alias) != null)
        {
            throw new KeyStoreException("There is a key entry with the name " + alias + ".");
        }

        certs.put(alias, cert);
        chainCerts.put(new CertId(cert.getPublicKey()), cert);
    }
View Full Code Here

        Certificate[]   chain)
        throws KeyStoreException
    {
        if ((key instanceof PrivateKey) && (chain == null))
        {
            throw new KeyStoreException("no certificate chain for private key");
        }

        if (keys.get(alias) != null)
        {
            engineDeleteEntry(alias);
View Full Code Here

            }
        }

        if (c == null && k == null)
        {
            throw new KeyStoreException("no such entry as " + alias);
        }
    }
View Full Code Here

        Certificate cert)
        throws KeyStoreException
    {
        if (certs.get(alias) != null)
        {
            throw new KeyStoreException("There is already a certificate with the name " + alias + ".");
        }

        certs.put(alias, cert);
        chainCerts.put(new CertId(cert.getPublicKey()), cert);
    }
View Full Code Here

TOP

Related Classes of java.security.KeyStoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.