Search in sources :

Example 1 with TableEntry

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

the class DSAPrivateKeyContentProvider method getAlgorithmElements.

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

Example 2 with TableEntry

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

the class DSAPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        DSAKeyFactory keyFactory = new DSAKeyFactory();
        DSAPrivateKeySpec keySpec = (DSAPrivateKeySpec) keyFactory.getKeySpec(key, DSAPrivateKeySpec.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) DSAKeyFactory(de.flexiprovider.core.dsa.DSAKeyFactory) DSAPrivateKeySpec(de.flexiprovider.core.dsa.DSAPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Example 3 with TableEntry

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

the class DSAPrivateKeyContentProvider method getParameters.

private List<TableEntry> getParameters(DSAKey key) {
    DSAParams params = (DSAParams) key.getParams();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_baseg, "" + params.getBaseG()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_primep, "" + params.getPrimeP()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_primeq, "" + params.getPrimeQ()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) DSAParams(de.flexiprovider.core.dsa.interfaces.DSAParams)

Example 4 with TableEntry

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

the class ECPublicKeyContentProvider method getParameters.

private List<TableEntry> getParameters(ECPublicKey key) {
    CurveParams params = (CurveParams) key.getParams();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + params.getK()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_r, "" + params.getR()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + params.getOID()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_ellipticcurve, "" + params.getE()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_g, "" + params.getG()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_q, "" + params.getQ()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) CurveParams(de.flexiprovider.ec.parameters.CurveParams) ArrayList(java.util.ArrayList)

Example 5 with TableEntry

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

the class ECPublicKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ECPublicKey key = (ECPublicKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_w, "" + key.getW()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_encodedw, "" + key.getEncodedW()));
        paramElements.addAll(getParameters(key));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeyException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ECPublicKey(de.flexiprovider.ec.keys.ECPublicKey) ArrayList(java.util.ArrayList) InvalidKeyException(de.flexiprovider.api.exceptions.InvalidKeyException)

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