use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class AbstractKeyNodeContentProvider method getAliasElements.
private List<TableEntry> getAliasElements(Object inputElement) {
AbstractKeyNode node = (AbstractKeyNode) inputElement;
IKeyStoreAlias alias = node.getAlias();
List<TableEntry> elements = new ArrayList<TableEntry>();
elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Alias, alias.getAliasString()));
elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_ContactName, alias.getContactName()));
// $NON-NLS-2$
elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_KeyLength, "" + alias.getKeyLength()));
elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Operation, alias.getOperation()));
elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_AsString, alias.toString()));
return elements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class AbstractKeyNodeContentProvider method getCipherElements.
private List<TableEntry> getCipherElements(Object inputElement) {
Key key = (Key) inputElement;
if (key == null)
return null;
List<TableEntry> cipherElements = new ArrayList<TableEntry>();
try {
Cipher cipher = Registry.getCipher(key.getAlgorithm());
if (cipher.getIV() != null)
cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_InitVector, cipher.getIV().toString()));
if (cipher.getBlockSize() != 0)
cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_BlockSize, Integer.toString(cipher.getBlockSize())));
try {
cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_CipherKeySize, Integer.toString(cipher.getKeySize(key))));
} catch (InvalidKeyException ex) {
LogUtil.logError(ex);
}
} catch (NoSuchAlgorithmException e) {
return cipherElements;
}
return cipherElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class CertificateContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
CertificateNode treeNode = (CertificateNode) inputElement;
IKeyStoreAlias alias = treeNode.getAlias();
try {
Certificate cert = KeyStoreManager.getInstance().getCertificate(alias);
Object[] certElements = { new TableEntry(Messages.CertificateContentProvider_CertType, cert.getType()) };
return merge(super.getElements(inputElement), certElements);
} catch (UnrecoverableEntryException e) {
LogUtil.logError(KeyStorePlugin.PLUGIN_ID, e);
} catch (NoSuchAlgorithmException e) {
LogUtil.logError(KeyStorePlugin.PLUGIN_ID, e);
}
return null;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class ElGamalPublicKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
ElGamalPublicKey key = (ElGamalPublicKey) inputElement;
if (key == null)
return null;
// $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 GMSSPublicKeyContentProvider method getParameters.
private List<TableEntry> getParameters(GMSSPublicKeySpec keySpec) {
GMSSParameterset params = (GMSSParameterset) keySpec.getGMSSParameterset();
List<TableEntry> paramElements = new ArrayList<TableEntry>();
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_numoflayers, "" + params.getNumOfLayers()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + Arrays.toString(params.getK())));
paramElements.add(new TableEntry(Messages.ContentProvider_heightoftrees, // $NON-NLS-2$
"" + Arrays.toString(params.getHeightOfTrees())));
paramElements.add(new TableEntry(Messages.ContentProvider_winternitzparameter, // $NON-NLS-2$
"" + Arrays.toString(params.getWinternitzParameter())));
return paramElements;
}
Aggregations