use of de.flexiprovider.pqc.ecc.mceliece.McElieceKeyFactory in project core by jcryptool.
the class McEliecePrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceKeyFactory keyFactory = new McElieceKeyFactory();
McEliecePrivateKeySpec keySpec = (McEliecePrivateKeySpec) keyFactory.getKeySpec(key, McEliecePrivateKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + keySpec.getK()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_field, "" + keySpec.getField()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_goppapoly, "" + keySpec.getGoppaPoly()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_h, "" + keySpec.getH()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_p1, "" + keySpec.getP1()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_p2, "" + keySpec.getP2()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + keySpec.getQInv()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_sinv, "" + keySpec.getSInv()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.pqc.ecc.mceliece.McElieceKeyFactory 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