Search in sources :

Example 16 with TableEntry

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

the class IQGQPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        IQGQKeyFactory keyFactory = new IQGQKeyFactory();
        IQGQPrivateKeySpec keySpec = (IQGQPrivateKeySpec) keyFactory.getKeySpec(key, IQGQPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_exponent, "" + keySpec.getExponent()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_theta, "" + keySpec.getTheta()));
        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) IQGQKeyFactory(de.flexiprovider.nf.iq.iqgq.IQGQKeyFactory) ArrayList(java.util.ArrayList) IQGQPrivateKeySpec(de.flexiprovider.nf.iq.iqgq.IQGQPrivateKeySpec) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Example 17 with TableEntry

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

the class IQGQPublicKeyContentProvider method getKeySpecElements.

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

Example 18 with TableEntry

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

the class IQRDSAPublicKeyContentProvider method getParameters.

private List<TableEntry> getParameters(IQRDSAPublicKeySpec 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 19 with TableEntry

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

the class LMOTSPublicKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        LMOTSPublicKey key = (LMOTSPublicKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_hashedk, "" + key.getHashedK()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_hashedl, "" + key.getHashedL()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_hashfunc, "" + key.getHashFunction()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) LMOTSPublicKey(de.flexiprovider.pqc.ots.lm.LMOTSPublicKey) ArrayList(java.util.ArrayList)

Example 20 with TableEntry

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

the class McElieceCCA2PrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        McElieceCCA2KeyFactory keyFactory = new McElieceCCA2KeyFactory();
        McElieceCCA2PrivateKeySpec keySpec = (McElieceCCA2PrivateKeySpec) keyFactory.getKeySpec(key, McElieceCCA2PrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + keySpec.getK()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_field, "" + keySpec.getField()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_goppapoly, "" + keySpec.getGoppaPoly()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_h, "" + keySpec.getH()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_p, "" + keySpec.getP()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + keySpec.getQInv()));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) McElieceCCA2KeyFactory(de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2KeyFactory) McElieceCCA2PrivateKeySpec(de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PrivateKeySpec) 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