use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class McElieceCCA2PrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceCCA2KeyFactory keyFactory = new McElieceCCA2KeyFactory();
McElieceCCA2PrivateKeySpec keySpec = (McElieceCCA2PrivateKeySpec) keyFactory.getKeySpec(key, McElieceCCA2PrivateKeySpec.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_p, "" + keySpec.getP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + keySpec.getQInv()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException 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.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class NiederreiterPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
NiederreiterKeyFactory keyFactory = new NiederreiterKeyFactory();
NiederreiterPrivateKeySpec keySpec = (NiederreiterPrivateKeySpec) keyFactory.getKeySpec(key, NiederreiterPrivateKeySpec.class);
if (keySpec == null)
return null;
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class PFlashPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
PFlashKeyFactory keyFactory = new PFlashKeyFactory();
PFlashPublicKeySpec keySpec = (PFlashPublicKeySpec) keyFactory.getKeySpec(key, PFlashPublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class RainbowPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
RainbowKeyFactory keyFactory = new RainbowKeyFactory();
RainbowPublicKeySpec keySpec = (RainbowPublicKeySpec) keyFactory.getKeySpec(key, RainbowPublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_doclength, "" + keySpec.getDocLength()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations