Search in sources :

Example 1 with ElGamalPrivateKey

use of de.flexiprovider.core.elgamal.ElGamalPrivateKey in project core by jcryptool.

the class ElGamalPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ElGamalPrivateKey key = (ElGamalPrivateKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_a, "" + key.getA()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_generator, "" + key.getGenerator()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_publica, "" + key.getPublicA()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) ElGamalPrivateKey(de.flexiprovider.core.elgamal.ElGamalPrivateKey)

Aggregations

ElGamalPrivateKey (de.flexiprovider.core.elgamal.ElGamalPrivateKey)1 ArrayList (java.util.ArrayList)1 TableEntry (org.jcryptool.crypto.keystore.ui.dialogs.TableEntry)1