use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class PFlashPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
PFlashKeyFactory keyFactory = new PFlashKeyFactory();
PFlashPublicKeySpec keySpec = (PFlashPublicKeySpec) keyFactory.getKeySpec(key, PFlashPublicKeySpec.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 RSAPublicKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
RSAPublicKey key = (RSAPublicKey) inputElement;
if (key == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_e, "" + key.getE()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_publicexponent, "" + key.getPublicExponent()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class RainbowPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
RainbowKeyFactory keyFactory = new RainbowKeyFactory();
RainbowPublicKeySpec keySpec = (RainbowPublicKeySpec) keyFactory.getKeySpec(key, RainbowPublicKeySpec.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_doclength, "" + keySpec.getDocLength()));
} 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 getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
SSVElGamalPrivateKey key = (SSVElGamalPrivateKey) 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_modulusp, "" + key.getModulusP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_modulusq, "" + key.getModulusQ()));
// $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 AbstractKeyNodeContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
Object[] elements = super.getElements(inputElement);
Key key = getKey(inputElement);
List<TableEntry> aliasElements = getAliasElements(inputElement);
List<TableEntry> keyElements = getKeyElements(key);
List<TableEntry> keySpecElements = getKeySpecElements(key);
List<TableEntry> cipherElements = getCipherElements(key);
List<TableEntry> algorithmElements = getAlgorithmElements(key);
List<Object> abstractKeyNodeElements = new ArrayList<Object>();
if (elements != null)
abstractKeyNodeElements.addAll(Arrays.asList(elements));
if (aliasElements != null)
abstractKeyNodeElements.addAll(aliasElements);
if (keyElements != null)
abstractKeyNodeElements.addAll(keyElements);
if (cipherElements != null)
abstractKeyNodeElements.addAll(cipherElements);
if (algorithmElements != null)
abstractKeyNodeElements.addAll(algorithmElements);
if (keySpecElements != null)
abstractKeyNodeElements.addAll(keySpecElements);
return abstractKeyNodeElements.toArray();
}
Aggregations