use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class AbstractKeyNodeContentProvider method getKeyElements.
private List<TableEntry> getKeyElements(Object inputElement) {
Key key = (Key) inputElement;
if (key == null)
return null;
List<TableEntry> list = new ArrayList<TableEntry>();
list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Algorithm, key.getAlgorithm()));
list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Format, key.getFormat()));
list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Encoded, Arrays.toString(key.getEncoded())));
return list;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class GMSSPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
GMSSKeyFactory keyFactory = new GMSSKeyFactory();
GMSSPrivateKeySpec keySpec = (GMSSPrivateKeySpec) keyFactory.getKeySpec(key, GMSSPrivateKeySpec.class);
if (keySpec == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_algnames, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getAlgNames())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_curauthpath, "" + keySpec.getCurrentAuthPath()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_curretain, "" + keySpec.getCurrentRetain()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_currootsig, "" + keySpec.getCurrentRootSig()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_curseed, "" + keySpec.getCurrentSeed()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_curstack, "" + keySpec.getCurrentStack()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_curtreehash, "" + keySpec.getCurrentTreehash()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_index, "" + Arrays.toString(keySpec.getIndex())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_keep, "" + keySpec.getKeep()));
paramElements.add(new TableEntry(Messages.ContentProvider_mintreehash, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getMinTreehash())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nextauthpath, "" + keySpec.getNextAuthPath()));
paramElements.add(new TableEntry(Messages.ContentProvider_nextnextleaf, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getNextNextLeaf())));
paramElements.add(new TableEntry(Messages.ContentProvider_nextnextroot, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getNextNextRoot())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nextnextseed, "" + keySpec.getNextNextSeed()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nextretain, "" + keySpec.getNextRetain()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nextroot, "" + keySpec.getNextRoot()));
paramElements.add(new TableEntry(Messages.ContentProvider_nextrootsig, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getNextRootSig())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nextstack, "" + keySpec.getNextStack()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_nexttreehash, "" + keySpec.getNextTreehash()));
paramElements.add(new TableEntry(Messages.ContentProvider_upperleaf, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getUpperLeaf())));
paramElements.add(new TableEntry(Messages.ContentProvider_uppertreehashleaf, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getUpperTreehashLeaf())));
paramElements.addAll(getParameters(keySpec));
} 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 GMSSPrivateKeyContentProvider method getParameters.
private List<TableEntry> getParameters(GMSSPrivateKeySpec keySpec) {
GMSSParameterset params = (GMSSParameterset) keySpec.getGmssPS();
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_numoflayers, "" + 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;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class GMSSPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
GMSSPrivateKey key = (GMSSPrivateKey) inputElement;
if (key == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_detailedname, Arrays.toString(key.getName())));
} 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 getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
GMSSKeyFactory keyFactory = new GMSSKeyFactory();
GMSSPublicKeySpec keySpec = (GMSSPublicKeySpec) keyFactory.getKeySpec(key, GMSSPublicKeySpec.class);
if (keySpec == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_publickey, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getPublicKey())));
paramElements.addAll(getParameters(keySpec));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations