Search in sources :

Example 16 with InvalidKeySpecException

use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.

the class CMSSPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        CMSSKeyFactory keyFactory = new CMSSKeyFactory();
        CMSSPrivateKeySpec keySpec = (CMSSPrivateKeySpec) keyFactory.getKeySpec(key, CMSSPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_activesubtree, "" + keySpec.getActiveSubtree()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_heightoftrees, "" + keySpec.getHeightOfTrees()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_indexmain, "" + keySpec.getIndexMain()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_indexsub, "" + keySpec.getIndexSub()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
        paramElements.add(new TableEntry(Messages.ContentProvider_maintreeotskey, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getMaintreeOTSVerificationKey())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_masks, "" + keySpec.getMasks()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_seeds, "" + keySpec.getSeeds()));
        paramElements.add(new TableEntry(Messages.ContentProvider_subtreerootsig, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getSubtreeRootSig())));
        paramElements.add(new TableEntry(Messages.ContentProvider_authpaths, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getAuthPaths())));
    } 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) CMSSKeyFactory(de.flexiprovider.pqc.hbc.cmss.CMSSKeyFactory) CMSSPrivateKeySpec(de.flexiprovider.pqc.hbc.cmss.CMSSPrivateKeySpec)

Example 17 with InvalidKeySpecException

use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.

the class CMSSPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        CMSSKeyFactory keyFactory = new CMSSKeyFactory();
        CMSSPublicKeySpec keySpec = (CMSSPublicKeySpec) keyFactory.getKeySpec(key, CMSSPublicKeySpec.class);
        if (keySpec == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_pubkeybytes, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getPubKeyBytes())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_masks, "" + keySpec.getMasks()));
    } 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) CMSSPublicKeySpec(de.flexiprovider.pqc.hbc.cmss.CMSSPublicKeySpec) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) CMSSKeyFactory(de.flexiprovider.pqc.hbc.cmss.CMSSKeyFactory)

Example 18 with InvalidKeySpecException

use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.

the class PFlashPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        PFlashKeyFactory keyFactory = new PFlashKeyFactory();
        PFlashPrivateKeySpec keySpec = (PFlashPrivateKeySpec) keyFactory.getKeySpec(key, PFlashPrivateKeySpec.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_c_s, "" + keySpec.getC_S()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_c_t, "" + keySpec.getC_T()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_m_s, "" + keySpec.getM_S()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_m_t, "" + keySpec.getM_T()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_poly_384, "" + keySpec.getPoly_384()));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) PFlashPrivateKeySpec(de.flexiprovider.pqc.pflash.PFlashPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) PFlashKeyFactory(de.flexiprovider.pqc.pflash.PFlashKeyFactory)

Example 19 with InvalidKeySpecException

use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.

the class RainbowPrivateKeyContentProvider method getKeySpecElements.

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

Example 20 with InvalidKeySpecException

use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.

the class SSVElGamalPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        SSVElGamalKeyFactory keyFactory = new SSVElGamalKeyFactory();
        SSVElGamalPrivateKeySpec keySpec = (SSVElGamalPrivateKeySpec) keyFactory.getKeySpec(key, SSVElGamalPrivateKeySpec.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) SSVElGamalKeyFactory(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalKeyFactory) SSVElGamalPrivateKeySpec(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPrivateKeySpec) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Aggregations

InvalidKeySpecException (de.flexiprovider.api.exceptions.InvalidKeySpecException)27 ArrayList (java.util.ArrayList)26 TableEntry (org.jcryptool.crypto.keystore.ui.dialogs.TableEntry)26 SSVElGamalKeyFactory (de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalKeyFactory)2 IQDSAKeyFactory (de.flexiprovider.nf.iq.iqdsa.IQDSAKeyFactory)2 IQGQKeyFactory (de.flexiprovider.nf.iq.iqgq.IQGQKeyFactory)2 IQRDSAKeyFactory (de.flexiprovider.nf.iq.iqrdsa.IQRDSAKeyFactory)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 MerkleOTSKeyFactory (de.flexiprovider.pqc.ots.merkle.MerkleOTSKeyFactory)2 PFlashKeyFactory (de.flexiprovider.pqc.pflash.PFlashKeyFactory)2 RainbowKeyFactory (de.flexiprovider.pqc.rainbow.RainbowKeyFactory)2 NoSuchAlgorithmException (de.flexiprovider.api.exceptions.NoSuchAlgorithmException)1 KeyFactory (de.flexiprovider.api.keys.KeyFactory)1 KeySpec (de.flexiprovider.api.keys.KeySpec)1 SecretKey (de.flexiprovider.api.keys.SecretKey)1 DSAKeyFactory (de.flexiprovider.core.dsa.DSAKeyFactory)1