use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class SSVElGamalPublicKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
SSVElGamalPublicKey key = (SSVElGamalPublicKey) 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_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 SSVElGamalPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
SSVElGamalKeyFactory keyFactory = new SSVElGamalKeyFactory();
SSVElGamalPublicKeySpec keySpec = (SSVElGamalPublicKeySpec) keyFactory.getKeySpec(key, SSVElGamalPublicKeySpec.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 ECSecretKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
ECSecretKey key = (ECSecretKey) inputElement;
if (key == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_s, "" + key.getS()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class PBESecretKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
ECSecretKey key = (ECSecretKey) inputElement;
if (key == null)
return null;
paramElements.add(new TableEntry(Messages.ContentProvider_s, key.getS().toString()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class PBESecretKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
PBEKeyFactory keyFactory = new PBEKeyFactory();
PBEKeySpec keySpec = (PBEKeySpec) keyFactory.getKeySpec((SecretKey) key, PBEKeySpec.class);
if (keySpec == null)
return null;
paramElements.add(// $NON-NLS-2$
new TableEntry(Messages.ContentProvider_iterationcount, "" + keySpec.getIterationCount()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_keylength, "" + keySpec.getKeyLength()));
paramElements.add(new TableEntry(Messages.ContentProvider_password, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getPassword())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_salt, "" + Arrays.toString(keySpec.getSalt())));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations