Methods Summary |
---|
public java.util.Enumeration | engineAliases()
return Collections.enumeration(aliases.keySet());
|
public boolean | engineContainsAlias(java.lang.String alias)
return aliases.containsKey(alias);
|
public void | engineDeleteEntry(java.lang.String alias)
throw new KeyStoreException("entry " + alias + " cannot be deleted");
|
public java.security.cert.Certificate | engineGetCertificate(java.lang.String alias)
return (Certificate) aliases.get(alias);
|
public java.lang.String | engineGetCertificateAlias(java.security.cert.Certificate cert)
if (cert == null) {
throw new NullPointerException();
}
for (Map.Entry<String, Object> alias : aliases.entrySet()) {
if (alias.getValue() == cert) {
return alias.getKey();
}
}
return null;
|
public java.security.cert.Certificate[] | engineGetCertificateChain(java.lang.String alias)
return (Certificate[]) aliases.get(alias);
|
public java.util.Date | engineGetCreationDate(java.lang.String alias)
return new Date(42 * 1024 * 1024);
|
public java.security.Key | engineGetKey(java.lang.String alias, char[] password)
if (engineContainsAlias(alias)) {
if (!engineIsKeyEntry(alias)) {
if (password == null) {
throw new NoSuchAlgorithmException("no such alg");
} else {
throw new UnrecoverableKeyException();
}
}
return (Key) aliases.get(alias);
}
throw new UnrecoverableKeyException();
|
public boolean | engineIsCertificateEntry(java.lang.String alias)
try {
Certificate c = (Certificate) aliases.get(alias);
return true;
} catch (ClassCastException e) {
return false;
}
|
public boolean | engineIsKeyEntry(java.lang.String alias)
try {
Key k = (Key) aliases.get(alias);
return true;
} catch (ClassCastException e) {
return false;
}
|
public void | engineLoad(java.io.InputStream stream, char[] password)
if (stream != null) {
if (stream.available() == 0)
{
throw new IOException();
}
}
if (password == null) {
throw new NoSuchAlgorithmException();
} else if (password.length == 0) {
throw new CertificateException();
}
|
public void | engineLoad(java.security.KeyStore.LoadStoreParameter param)
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();
|
public void | engineSetCertificateEntry(java.lang.String alias, java.security.cert.Certificate cert)
if (engineContainsAlias(alias)) {
if (!engineIsCertificateEntry(alias)) {
throw new KeyStoreException("alias is not a cert entry");
}
}
aliases.put(alias, cert);
|
public void | engineSetKeyEntry(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain)
if (engineContainsAlias(alias)) {
if (!engineIsKeyEntry(alias)) {
throw new KeyStoreException("alias is not a key enrty");
}
}
if (key instanceof PrivateKey)
{
if (chain == null || chain.length == 0) {
throw new IllegalArgumentException();
}
}
aliases.put(alias, key);
|
public void | engineSetKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain)
throw new KeyStoreException("set entry failed");
|
public int | engineSize()
return aliases.size();
|
public void | engineStore(java.io.OutputStream stream, char[] password)
if (stream == null) {
throw new IOException("store failed");
}
if (password == null) {
throw new NoSuchAlgorithmException();
} else if (password.length == 0) {
throw new CertificateException();
}
|
public void | engineStore(java.security.KeyStore.LoadStoreParameter param)
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();
|