use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class ECPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
ECPrivateKey key = (ECPrivateKey) inputElement;
if (key == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_s, key.getS().toString()));
paramElements.addAll(getParameters(key));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class PFlashPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
PFlashKeyFactory keyFactory = new PFlashKeyFactory();
PFlashPrivateKeySpec keySpec = (PFlashPrivateKeySpec) keyFactory.getKeySpec(key, PFlashPrivateKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_c_s, "" + keySpec.getC_S()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_c_t, "" + keySpec.getC_T()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_m_s, "" + keySpec.getM_S()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_m_t, "" + keySpec.getM_T()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_poly_384, "" + keySpec.getPoly_384()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class RainbowPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
RainbowKeyFactory keyFactory = new RainbowKeyFactory();
RainbowPrivateKeySpec keySpec = (RainbowPrivateKeySpec) keyFactory.getKeySpec(key, RainbowPrivateKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class SSVElGamalPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
SSVElGamalKeyFactory keyFactory = new SSVElGamalKeyFactory();
SSVElGamalPrivateKeySpec keySpec = (SSVElGamalPrivateKeySpec) keyFactory.getKeySpec(key, SSVElGamalPrivateKeySpec.class);
if (keySpec == null)
return null;
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations