Search in sources :

Example 1 with ECPublicKey

use of de.flexiprovider.ec.keys.ECPublicKey in project core by jcryptool.

the class ECPublicKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ECPublicKey key = (ECPublicKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_w, "" + key.getW()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_encodedw, "" + key.getEncodedW()));
        paramElements.addAll(getParameters(key));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeyException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ECPublicKey(de.flexiprovider.ec.keys.ECPublicKey) ArrayList(java.util.ArrayList) InvalidKeyException(de.flexiprovider.api.exceptions.InvalidKeyException)

Aggregations

InvalidKeyException (de.flexiprovider.api.exceptions.InvalidKeyException)1 ECPublicKey (de.flexiprovider.ec.keys.ECPublicKey)1 ArrayList (java.util.ArrayList)1 TableEntry (org.jcryptool.crypto.keystore.ui.dialogs.TableEntry)1