Search in sources :

Example 6 with TableEntry

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

the class AbstractKeyNodeContentProvider method getAliasElements.

private List<TableEntry> getAliasElements(Object inputElement) {
    AbstractKeyNode node = (AbstractKeyNode) inputElement;
    IKeyStoreAlias alias = node.getAlias();
    List<TableEntry> elements = new ArrayList<TableEntry>();
    elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Alias, alias.getAliasString()));
    elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_ContactName, alias.getContactName()));
    // $NON-NLS-2$
    elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_KeyLength, "" + alias.getKeyLength()));
    elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_Operation, alias.getOperation()));
    elements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_AsString, alias.toString()));
    return elements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) AbstractKeyNode(org.jcryptool.crypto.keystore.ui.views.nodes.keys.AbstractKeyNode) ArrayList(java.util.ArrayList) IKeyStoreAlias(org.jcryptool.crypto.keystore.keys.IKeyStoreAlias)

Example 7 with TableEntry

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

the class AbstractKeyNodeContentProvider method getCipherElements.

private List<TableEntry> getCipherElements(Object inputElement) {
    Key key = (Key) inputElement;
    if (key == null)
        return null;
    List<TableEntry> cipherElements = new ArrayList<TableEntry>();
    try {
        Cipher cipher = Registry.getCipher(key.getAlgorithm());
        if (cipher.getIV() != null)
            cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_InitVector, cipher.getIV().toString()));
        if (cipher.getBlockSize() != 0)
            cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_BlockSize, Integer.toString(cipher.getBlockSize())));
        try {
            cipherElements.add(new TableEntry(Messages.AbstractKeyNodeContentProvider_CipherKeySize, Integer.toString(cipher.getKeySize(key))));
        } catch (InvalidKeyException ex) {
            LogUtil.logError(ex);
        }
    } catch (NoSuchAlgorithmException e) {
        return cipherElements;
    }
    return cipherElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) Cipher(de.flexiprovider.api.Cipher) NoSuchAlgorithmException(de.flexiprovider.api.exceptions.NoSuchAlgorithmException) InvalidKeyException(de.flexiprovider.api.exceptions.InvalidKeyException) Key(de.flexiprovider.api.keys.Key)

Example 8 with TableEntry

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

the class CertificateContentProvider method getElements.

@Override
public Object[] getElements(Object inputElement) {
    CertificateNode treeNode = (CertificateNode) inputElement;
    IKeyStoreAlias alias = treeNode.getAlias();
    try {
        Certificate cert = KeyStoreManager.getInstance().getCertificate(alias);
        Object[] certElements = { new TableEntry(Messages.CertificateContentProvider_CertType, cert.getType()) };
        return merge(super.getElements(inputElement), certElements);
    } catch (UnrecoverableEntryException e) {
        LogUtil.logError(KeyStorePlugin.PLUGIN_ID, e);
    } catch (NoSuchAlgorithmException e) {
        LogUtil.logError(KeyStorePlugin.PLUGIN_ID, e);
    }
    return null;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) CertificateNode(org.jcryptool.crypto.keystore.ui.views.nodes.keys.CertificateNode) UnrecoverableEntryException(java.security.UnrecoverableEntryException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) IKeyStoreAlias(org.jcryptool.crypto.keystore.keys.IKeyStoreAlias) Certificate(java.security.cert.Certificate)

Example 9 with TableEntry

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

the class ElGamalPublicKeyContentProvider method getAlgorithmElements.

@Override
protected List<TableEntry> getAlgorithmElements(Object inputElement) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        ElGamalPublicKey key = (ElGamalPublicKey) inputElement;
        if (key == null)
            return null;
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_generator, "" + key.getGenerator()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_modulus, "" + key.getModulus()));
        // $NON-NLS-2$
        paramElements.add(new TableEntry(Messages.ContentProvider_publica, "" + key.getPublicA()));
    } catch (ClassCastException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) ArrayList(java.util.ArrayList) ElGamalPublicKey(de.flexiprovider.core.elgamal.ElGamalPublicKey)

Example 10 with TableEntry

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

the class GMSSPublicKeyContentProvider method getParameters.

private List<TableEntry> getParameters(GMSSPublicKeySpec keySpec) {
    GMSSParameterset params = (GMSSParameterset) keySpec.getGMSSParameterset();
    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_k, "" + 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)

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