use of de.flexiprovider.pqc.ecc.mceliece.McEliecePublicKeySpec in project core by jcryptool.
the class McEliecePublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceKeyFactory keyFactory = new McElieceKeyFactory();
McEliecePublicKeySpec keySpec = (McEliecePublicKeySpec) keyFactory.getKeySpec(key, McEliecePublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + keySpec.getT()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_g, "" + keySpec.getG()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations