use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry 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;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class MeRSAPrivateKeyContentProvider method getAlgorithmElements.
@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MeRSAPrivateKey key = (MeRSAPrivateKey) 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_k, "" + key.getK()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
// $NON-NLS-2$
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_einvp, "" + key.getEInvP()));
// $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()));
} catch (ClassCastException e) {
return null;
}
return paramElements;
}
use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.
the class MerkleOTSPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
MerkleOTSPrivateKeySpec keySpec = (MerkleOTSPrivateKeySpec) keyFactory.getKeySpec(key, MerkleOTSPrivateKeySpec.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_keybytes, "" + keySpec.getKeyBytes()));
} 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 MerkleOTSPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
MerkleOTSPublicKeySpec keySpec = (MerkleOTSPublicKeySpec) keyFactory.getKeySpec(key, MerkleOTSPublicKeySpec.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_keybytes, "" + keySpec.getKeyBytes()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations