Search in sources :

Example 11 with TableEntry

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

the class IQDSAPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        IQDSAKeyFactory keyFactory = new IQDSAKeyFactory();
        IQDSAPrivateKeySpec keySpec = (IQDSAPrivateKeySpec) keyFactory.getKeySpec(key, IQDSAPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_a, "" + keySpec.getA()));
        paramElements.addAll(getParameters(keySpec));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) IQDSAPrivateKeySpec(de.flexiprovider.nf.iq.iqdsa.IQDSAPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) IQDSAKeyFactory(de.flexiprovider.nf.iq.iqdsa.IQDSAKeyFactory)

Example 12 with TableEntry

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

the class IQDSAPrivateKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQDSAPrivateKeySpec keySpec) {
    IQDSAParameterSpec params = (IQDSAParameterSpec) keySpec.getParams();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_discriminant, "" + params.getDiscriminant()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_gamma, "" + params.getGamma()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) IQDSAParameterSpec(de.flexiprovider.nf.iq.iqdsa.IQDSAParameterSpec) ArrayList(java.util.ArrayList)

Example 13 with TableEntry

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

the class IQDSAPublicKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQDSAPublicKeySpec keySpec) {
    IQDSAParameterSpec params = (IQDSAParameterSpec) keySpec.getParams();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_discriminant, "" + params.getDiscriminant()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_gamma, "" + params.getGamma()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) IQDSAParameterSpec(de.flexiprovider.nf.iq.iqdsa.IQDSAParameterSpec) ArrayList(java.util.ArrayList)

Example 14 with TableEntry

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

the class IQDSAPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        IQDSAKeyFactory keyFactory = new IQDSAKeyFactory();
        IQDSAPublicKeySpec keySpec = (IQDSAPublicKeySpec) keyFactory.getKeySpec(key, IQDSAPublicKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_alpha, "" + keySpec.getAlpha()));
        paramElements.addAll(getParameters(keySpec));
    } 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) IQDSAKeyFactory(de.flexiprovider.nf.iq.iqdsa.IQDSAKeyFactory) IQDSAPublicKeySpec(de.flexiprovider.nf.iq.iqdsa.IQDSAPublicKeySpec)

Example 15 with TableEntry

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

the class IQGQPrivateKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQGQPrivateKeySpec keySpec) {
    IQGQParameterSpec params = (IQGQParameterSpec) keySpec.getParams();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_discriminant, "" + params.getDiscriminant()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) IQGQParameterSpec(de.flexiprovider.nf.iq.iqgq.IQGQParameterSpec) ArrayList(java.util.ArrayList)

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