PublicKeyStoreBuilderBasepublic class PublicKeyStoreBuilderBase extends com.sun.midp.publickeystore.PublicKeyStore A read-write serializable {@link PublicKeyStore}. This class is the base
for {@link PublicKeyStoreBuilder}, and does not have any methods that
depend on any Microediton specific classes so it can be used alone in a
tool written with Standard Edition Java. |
Fields Summary |
---|
private Vector | keyListVecor of keys maintained as a list. |
Constructors Summary |
---|
public PublicKeyStoreBuilderBase()Constructs an empty read-write keystore.
initPublicKeyStore(keyList);
| public PublicKeyStoreBuilderBase(InputStream in)Constructs a read-write keystore from a serialized keystore created
by this class.
initPublicKeyStore(in, keyList);
|
Methods Summary |
---|
public synchronized void | addKey(com.sun.midp.publickeystore.PublicKeyInfo keyInfo)Adds a public key.
keyList.addElement(keyInfo);
| public void | deleteKey(int number)Deletes a public key from this keystore by number.
keyList.removeElementAt(number);
| private void | putKeyInStorage(OutputStorage storage, com.sun.midp.publickeystore.PublicKeyInfo key)Serializes every field with a tag.
storage.writeValue(PublicKeyInfo.OWNER_TAG, key.getOwner());
storage.writeValue(PublicKeyInfo.NOT_BEFORE_TAG, key.getNotBefore());
storage.writeValue(PublicKeyInfo.NOT_AFTER_TAG, key.getNotAfter());
storage.writeValue(PublicKeyInfo.MODULUS_TAG, key.getModulus());
storage.writeValue(PublicKeyInfo.EXPONENT_TAG, key.getExponent());
storage.writeValue(PublicKeyInfo.DOMAIN_TAG, key.getDomain());
| public void | serialize(java.io.OutputStream out)Serializes the keystore to the given stream.
OutputStorage storage = new OutputStorage(out);
Enumeration e;
PublicKeyInfo keyInfo;
e = keyList.elements();
while (e.hasMoreElements()) {
keyInfo = (PublicKeyInfo)e.nextElement();
putKeyInStorage(storage, keyInfo);
}
| public synchronized void | updateKey(int number, com.sun.midp.publickeystore.PublicKeyInfo newKeyInfo)Updates all of an key's information except for the security domain.
information in the store.
PublicKeyInfo oldKeyInfo;
oldKeyInfo = getKey(number);
newKeyInfo.setDomain(oldKeyInfo.getDomain());
keyList.setElementAt(newKeyInfo, number);
|
|