use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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 org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class MpRSAPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MpRSAPrivateKey key = (MpRSAPrivateKey) inputElement;
if (key == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_crtcoeff, "" + key.getCRTCoeff()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_crtcoefficient, "" + key.getCrtCoefficient()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_d, "" + key.getD()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_dp, "" + key.getDp()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_dq, "" + key.getDq()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_e, "" + key.getE()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
paramElements.add(new TableEntry(Messages.ContentProvider_p, "" + key.getP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_q, "" + key.getQ()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primeexponentp, "" + key.getPrimeExponentP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primeexponentq, "" + key.getPrimeExponentQ()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primep, "" + key.getPrimeP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_primeq, "" + key.getPrimeQ()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_privateexponent, "" + key.getPrivateExponent()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_publicexponent, "" + key.getPublicExponent()));
paramElements.add(new TableEntry(Messages.ContentProvider_otherprimeinfos, // $NON-NLS-2$
"" + Arrays.toString(key.getOtherPrimeInfo())));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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 org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class NiederreiterPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
NiederreiterPrivateKey key = (NiederreiterPrivateKey) inputElement;
if (key == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + key.getK()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_m, "" + key.getM()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + key.getT()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_p, "" + key.getP()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_field, "" + key.getField()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_goppapoly, "" + key.getGoppaPoly()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + key.getQInv()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_sinv, "" + key.getSInv()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class NiederreiterPublicKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
NiederreiterPublicKey key = (NiederreiterPublicKey) inputElement;
if (key == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + key.getK()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + key.getT()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_h, "" + key.getH()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
Aggregations