use of de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PublicKeySpec in project core by jcryptool.
the class McElieceCCA2PublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceCCA2KeyFactory keyFactory = new McElieceCCA2KeyFactory();
McElieceCCA2PublicKeySpec keySpec = (McElieceCCA2PublicKeySpec) keyFactory.getKeySpec(key, McElieceCCA2PublicKeySpec.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_matrixg, "" + keySpec.getMatrixG()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations