Search in sources :

Example 36 with TableEntry

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

the class IQGQPublicKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQGQPublicKeySpec 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)

Example 37 with TableEntry

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

the class IQRDSAPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        IQRDSAKeyFactory keyFactory = new IQRDSAKeyFactory();
        IQRDSAPrivateKeySpec keySpec = (IQRDSAPrivateKeySpec) keyFactory.getKeySpec(key, IQRDSAPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_a, "" + keySpec.getA()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_alpha, "" + keySpec.getAlpha()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_gamma, "" + keySpec.getGamma()));
        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) IQRDSAPrivateKeySpec(de.flexiprovider.nf.iq.iqrdsa.IQRDSAPrivateKeySpec) IQRDSAKeyFactory(de.flexiprovider.nf.iq.iqrdsa.IQRDSAKeyFactory)

Example 38 with TableEntry

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

the class IQRDSAPrivateKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQRDSAPrivateKeySpec keySpec) {
    IQRDSAParameterSpec params = (IQRDSAParameterSpec) 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_modulus, "" + params.getModulus()));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) IQRDSAParameterSpec(de.flexiprovider.nf.iq.iqrdsa.IQRDSAParameterSpec) ArrayList(java.util.ArrayList)

Example 39 with TableEntry

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

the class IQRDSAPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        IQRDSAKeyFactory keyFactory = new IQRDSAKeyFactory();
        IQRDSAPublicKeySpec keySpec = (IQRDSAPublicKeySpec) keyFactory.getKeySpec(key, IQRDSAPublicKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_alpha, "" + keySpec.getAlpha()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_gamma, "" + keySpec.getGamma()));
        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) IQRDSAPublicKeySpec(de.flexiprovider.nf.iq.iqrdsa.IQRDSAPublicKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) IQRDSAKeyFactory(de.flexiprovider.nf.iq.iqrdsa.IQRDSAKeyFactory)

Example 40 with TableEntry

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

the class LMOTSPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        LMOTSPrivateKey key = (LMOTSPrivateKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + Arrays.toString(key.getK().toArray())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_l, "" + Arrays.toString(key.getL().toArray())));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) LMOTSPrivateKey(de.flexiprovider.pqc.ots.lm.LMOTSPrivateKey)

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