use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class DSAPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
DSAPrivateKey key = (DSAPrivateKey) inputElement;
if (key == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_valuex, key.getValueX().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 DSAPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
DSAKeyFactory keyFactory = new DSAKeyFactory();
DSAPrivateKeySpec keySpec = (DSAPrivateKeySpec) keyFactory.getKeySpec(key, DSAPrivateKeySpec.class);
if (keySpec == null)
return null;
} 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 DSAPrivateKeyContentProvider method getParameters.
private List<TableEntry> getParameters(DSAKey key) {
DSAParams params = (DSAParams) key.getParams();
List<TableEntry> paramElements = new ArrayList<TableEntry>();
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_baseg, "" + params.getBaseG()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primep, "" + params.getPrimeP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primeq, "" + params.getPrimeQ()));
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class ECPublicKeyContentProvider method getParameters.
private List<TableEntry> getParameters(ECPublicKey key) {
CurveParams params = (CurveParams) key.getParams();
List<TableEntry> paramElements = new ArrayList<TableEntry>();
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + params.getK()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_r, "" + params.getR()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + params.getOID()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_ellipticcurve, "" + params.getE()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_g, "" + params.getG()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_q, "" + params.getQ()));
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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;
}
Aggregations