Search in sources :

Example 56 with TableEntry

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

the class McElieceCCA2PublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        McElieceCCA2KeyFactory keyFactory = new McElieceCCA2KeyFactory();
        McElieceCCA2PublicKeySpec keySpec = (McElieceCCA2PublicKeySpec) keyFactory.getKeySpec(key, McElieceCCA2PublicKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + keySpec.getT()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_matrixg, "" + keySpec.getMatrixG()));
    } 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) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) McElieceCCA2PublicKeySpec(de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PublicKeySpec)

Example 57 with TableEntry

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

the class McEliecePublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        McElieceKeyFactory keyFactory = new McElieceKeyFactory();
        McEliecePublicKeySpec keySpec = (McEliecePublicKeySpec) keyFactory.getKeySpec(key, McEliecePublicKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + keySpec.getT()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_g, "" + keySpec.getG()));
    } 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) McEliecePublicKeySpec(de.flexiprovider.pqc.ecc.mceliece.McEliecePublicKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Example 58 with TableEntry

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

the class MeRSAPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        MeRSAPrivateKey key = (MeRSAPrivateKey) 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_k, "" + key.getK()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + key.getN()));
        // $NON-NLS-2$
        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_einvp, "" + key.getEInvP()));
        // $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()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) MeRSAPrivateKey(de.flexiprovider.core.mersa.MeRSAPrivateKey) ArrayList(java.util.ArrayList)

Example 59 with TableEntry

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

the class MerkleOTSPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
        MerkleOTSPrivateKeySpec keySpec = (MerkleOTSPrivateKeySpec) keyFactory.getKeySpec(key, MerkleOTSPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_keybytes, "" + keySpec.getKeyBytes()));
    } 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) MerkleOTSKeyFactory(de.flexiprovider.pqc.ots.merkle.MerkleOTSKeyFactory) MerkleOTSPrivateKeySpec(de.flexiprovider.pqc.ots.merkle.MerkleOTSPrivateKeySpec)

Example 60 with TableEntry

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

the class MerkleOTSPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
        MerkleOTSPublicKeySpec keySpec = (MerkleOTSPublicKeySpec) keyFactory.getKeySpec(key, MerkleOTSPublicKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_keybytes, "" + keySpec.getKeyBytes()));
    } 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) MerkleOTSKeyFactory(de.flexiprovider.pqc.ots.merkle.MerkleOTSKeyFactory) MerkleOTSPublicKeySpec(de.flexiprovider.pqc.ots.merkle.MerkleOTSPublicKeySpec)

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