Search in sources :

Example 31 with TableEntry

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

the class AbstractKeyNodeContentProvider method getKeyElements.

private List<TableEntry> getKeyElements(Object inputElement) {
    Key key = (Key) inputElement;
    if (key == null)
        return null;
    List<TableEntry> list = new ArrayList<TableEntry>();
    list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Algorithm, key.getAlgorithm()));
    list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Format, key.getFormat()));
    list.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Encoded, Arrays.toString(key.getEncoded())));
    return list;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) Key(de.flexiprovider.api.keys.Key)

Example 32 with TableEntry

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

the class GMSSPrivateKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        GMSSKeyFactory keyFactory = new GMSSKeyFactory();
        GMSSPrivateKeySpec keySpec = (GMSSPrivateKeySpec) keyFactory.getKeySpec(key, GMSSPrivateKeySpec.class);
        if (keySpec == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_algnames, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getAlgNames())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_curauthpath, "" + keySpec.getCurrentAuthPath()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_curretain, "" + keySpec.getCurrentRetain()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_currootsig, "" + keySpec.getCurrentRootSig()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_curseed, "" + keySpec.getCurrentSeed()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_curstack, "" + keySpec.getCurrentStack()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_curtreehash, "" + keySpec.getCurrentTreehash()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_index, "" + Arrays.toString(keySpec.getIndex())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_keep, "" + keySpec.getKeep()));
        paramElements.add(new TableEntry(Messages.ContentProvider_mintreehash, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getMinTreehash())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nextauthpath, "" + keySpec.getNextAuthPath()));
        paramElements.add(new TableEntry(Messages.ContentProvider_nextnextleaf, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getNextNextLeaf())));
        paramElements.add(new TableEntry(Messages.ContentProvider_nextnextroot, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getNextNextRoot())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nextnextseed, "" + keySpec.getNextNextSeed()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nextretain, "" + keySpec.getNextRetain()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nextroot, "" + keySpec.getNextRoot()));
        paramElements.add(new TableEntry(Messages.ContentProvider_nextrootsig, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getNextRootSig())));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nextstack, "" + keySpec.getNextStack()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_nexttreehash, "" + keySpec.getNextTreehash()));
        paramElements.add(new TableEntry(Messages.ContentProvider_upperleaf, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getUpperLeaf())));
        paramElements.add(new TableEntry(Messages.ContentProvider_uppertreehashleaf, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getUpperTreehashLeaf())));
        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) GMSSKeyFactory(de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory) ArrayList(java.util.ArrayList) GMSSPrivateKeySpec(de.flexiprovider.pqc.hbc.gmss.GMSSPrivateKeySpec) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException)

Example 33 with TableEntry

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

the class GMSSPrivateKeyContentProvider method getParameters.

private List<TableEntry> getParameters(GMSSPrivateKeySpec keySpec) {
    GMSSParameterset params = (GMSSParameterset) keySpec.getGmssPS();
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_numoflayers, "" + params.getNumOfLayers()));
    // $NON-NLS-2$
    paramElements.add(new TableEntry(Messages.ContentProvider_numoflayers, "" + Arrays.toString(params.getK())));
    paramElements.add(new TableEntry(Messages.ContentProvider_heightoftrees, // $NON-NLS-2$
    "" + Arrays.toString(params.getHeightOfTrees())));
    paramElements.add(new TableEntry(Messages.ContentProvider_winternitzparameter, // $NON-NLS-2$
    "" + Arrays.toString(params.getWinternitzParameter())));
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) GMSSParameterset(de.flexiprovider.pqc.hbc.gmss.GMSSParameterset)

Example 34 with TableEntry

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

the class GMSSPrivateKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        GMSSPrivateKey key = (GMSSPrivateKey) inputElement;
        if (key == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_detailedname, Arrays.toString(key.getName())));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) GMSSPrivateKey(de.flexiprovider.pqc.hbc.gmss.GMSSPrivateKey)

Example 35 with TableEntry

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

the class GMSSPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        GMSSKeyFactory keyFactory = new GMSSKeyFactory();
        GMSSPublicKeySpec keySpec = (GMSSPublicKeySpec) keyFactory.getKeySpec(key, GMSSPublicKeySpec.class);
        if (keySpec == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_publickey, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getPublicKey())));
        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) GMSSKeyFactory(de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) GMSSPublicKeySpec(de.flexiprovider.pqc.hbc.gmss.GMSSPublicKeySpec)

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