Search in sources :

Example 46 with TableEntry

use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.

the class ECPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ECPrivateKey key = (ECPrivateKey) inputElement;
        if (key == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_s, key.getS().toString()));
        paramElements.addAll(getParameters(key));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ECPrivateKey(de.flexiprovider.ec.keys.ECPrivateKey) ArrayList(java.util.ArrayList)

Example 47 with TableEntry

use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.

the class ElGamalPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ElGamalPrivateKey key = (ElGamalPrivateKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_a, "" + key.getA()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_generator, "" + key.getGenerator()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_publica, "" + key.getPublicA()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) ElGamalPrivateKey(de.flexiprovider.core.elgamal.ElGamalPrivateKey)

Example 48 with TableEntry

use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.

the class PFlashPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        PFlashKeyFactory keyFactory = new PFlashKeyFactory();
        PFlashPrivateKeySpec keySpec = (PFlashPrivateKeySpec) keyFactory.getKeySpec(key, PFlashPrivateKeySpec.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_c_s, "" + keySpec.getC_S()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_c_t, "" + keySpec.getC_T()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_m_s, "" + keySpec.getM_S()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_m_t, "" + keySpec.getM_T()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_poly_384, "" + keySpec.getPoly_384()));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) PFlashPrivateKeySpec(de.flexiprovider.pqc.pflash.PFlashPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) PFlashKeyFactory(de.flexiprovider.pqc.pflash.PFlashKeyFactory)

Example 49 with TableEntry

use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.

the class RainbowPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        RainbowKeyFactory keyFactory = new RainbowKeyFactory();
        RainbowPrivateKeySpec keySpec = (RainbowPrivateKeySpec) keyFactory.getKeySpec(key, RainbowPrivateKeySpec.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;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) RainbowKeyFactory(de.flexiprovider.pqc.rainbow.RainbowKeyFactory) RainbowPrivateKeySpec(de.flexiprovider.pqc.rainbow.RainbowPrivateKeySpec)

Example 50 with TableEntry

use of org.jcryptool.crypto.keystore.ui.dialogs.TableEntry in project core by jcryptool.

the class SSVElGamalPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        SSVElGamalKeyFactory keyFactory = new SSVElGamalKeyFactory();
        SSVElGamalPrivateKeySpec keySpec = (SSVElGamalPrivateKeySpec) keyFactory.getKeySpec(key, SSVElGamalPrivateKeySpec.class);
        if (keySpec == null)
            return null;
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) SSVElGamalKeyFactory(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalKeyFactory) SSVElGamalPrivateKeySpec(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Aggregations

TableEntry (org.jcryptool.crypto.keystore.ui.dialogs.TableEntry)61 ArrayList (java.util.ArrayList)60 InvalidKeySpecException (de.flexiprovider.api.exceptions.InvalidKeySpecException)26 Key (de.flexiprovider.api.keys.Key)3 ECSecretKey (de.flexiprovider.ec.keys.ECSecretKey)3 InvalidKeyException (de.flexiprovider.api.exceptions.InvalidKeyException)2 DSAParams (de.flexiprovider.core.dsa.interfaces.DSAParams)2 SSVElGamalKeyFactory (de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalKeyFactory)2 CurveParams (de.flexiprovider.ec.parameters.CurveParams)2 IQDSAKeyFactory (de.flexiprovider.nf.iq.iqdsa.IQDSAKeyFactory)2 IQDSAParameterSpec (de.flexiprovider.nf.iq.iqdsa.IQDSAParameterSpec)2 IQGQKeyFactory (de.flexiprovider.nf.iq.iqgq.IQGQKeyFactory)2 IQGQParameterSpec (de.flexiprovider.nf.iq.iqgq.IQGQParameterSpec)2 IQRDSAKeyFactory (de.flexiprovider.nf.iq.iqrdsa.IQRDSAKeyFactory)2 IQRDSAParameterSpec (de.flexiprovider.nf.iq.iqrdsa.IQRDSAParameterSpec)2 McElieceCCA2KeyFactory (de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2KeyFactory)2 McElieceKeyFactory (de.flexiprovider.pqc.ecc.mceliece.McElieceKeyFactory)2 NiederreiterKeyFactory (de.flexiprovider.pqc.ecc.niederreiter.NiederreiterKeyFactory)2 CMSSKeyFactory (de.flexiprovider.pqc.hbc.cmss.CMSSKeyFactory)2 GMSSKeyFactory (de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory)2