use of de.flexiprovider.api.Cipher 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;
}
Aggregations