Search in sources :

Example 21 with TableEntry

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

the class McEliecePrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        McElieceKeyFactory keyFactory = new McElieceKeyFactory();
        McEliecePrivateKeySpec keySpec = (McEliecePrivateKeySpec) keyFactory.getKeySpec(key, McEliecePrivateKeySpec.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_p1, "" + keySpec.getP1()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_p2, "" + keySpec.getP2()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + keySpec.getQInv()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_sinv, "" + keySpec.getSInv()));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) McElieceKeyFactory(de.flexiprovider.pqc.ecc.mceliece.McElieceKeyFactory) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) McEliecePrivateKeySpec(de.flexiprovider.pqc.ecc.mceliece.McEliecePrivateKeySpec)

Example 22 with TableEntry

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

the class MpRSAPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        MpRSAPrivateKey key = (MpRSAPrivateKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_crtcoeff, "" + key.getCRTCoeff()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_crtcoefficient, "" + key.getCrtCoefficient()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_d, "" + key.getD()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_dp, "" + key.getDp()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_dq, "" + key.getDq()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_e, "" + key.getE()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
        paramElements.add(new TableEntry(Messages.ContentProvider_p, "" + key.getP()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_q, "" + key.getQ()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_primeexponentp, "" + key.getPrimeExponentP()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_primeexponentq, "" + key.getPrimeExponentQ()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_primep, "" + key.getPrimeP()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_primeq, "" + key.getPrimeQ()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_privateexponent, "" + key.getPrivateExponent()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_publicexponent, "" + key.getPublicExponent()));
        paramElements.add(new TableEntry(Messages.ContentProvider_otherprimeinfos, // $NON-NLS-2$
        "" + Arrays.toString(key.getOtherPrimeInfo())));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) MpRSAPrivateKey(de.flexiprovider.core.mprsa.MpRSAPrivateKey) ArrayList(java.util.ArrayList)

Example 23 with TableEntry

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

the class NiederreiterPrivateKeyContentProvider method getKeySpecElements.

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

Example 24 with TableEntry

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

the class NiederreiterPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        NiederreiterPrivateKey key = (NiederreiterPrivateKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + key.getK()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_m, "" + key.getM()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + key.getT()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_p, "" + key.getP()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_field, "" + key.getField()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_goppapoly, "" + key.getGoppaPoly()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_qinv, "" + key.getQInv()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_sinv, "" + key.getSInv()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) NiederreiterPrivateKey(de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPrivateKey) ArrayList(java.util.ArrayList)

Example 25 with TableEntry

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

the class NiederreiterPublicKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        NiederreiterPublicKey key = (NiederreiterPublicKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_k, "" + key.getK()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + key.getT()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_h, "" + key.getH()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) NiederreiterPublicKey(de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPublicKey)

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