Search in sources :

Example 1 with DSAPrivateKeyContentProvider

use of org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.DSAPrivateKeyContentProvider in project core by jcryptool.

the class ContentProviderFactory method create.

public static IStructuredContentProvider create(TreeNode treeNode) {
    IKeyStoreAlias alias = null;
    if (treeNode instanceof CertificateNode) {
        alias = ((CertificateNode) treeNode).getAlias();
    } else if (treeNode instanceof AbstractKeyNode) {
        alias = ((AbstractKeyNode) treeNode).getAlias();
    }
    if (alias == null) {
        return new CommonContentProvider();
    }
    KeyType keyType = alias.getKeyStoreEntryType();
    String className = alias.getClassName();
    switch(keyType) {
        case SECRETKEY:
            if (className.equals(ECSecretKey.class.getName())) {
                return new ECSecretKeyContentProvider();
            } else if (className.equals(PBEKey.class.getName())) {
                return new PBESecretKeyContentProvider();
            } else {
                return new AbstractKeyNodeContentProvider();
            }
        case PUBLICKEY:
            return new CertificateContentProvider();
        case KEYPAIR_PRIVATE_KEY:
            if (className.equals(DSAPrivateKey.class.getName())) {
                return new DSAPrivateKeyContentProvider();
            } else if (className.equals(ElGamalPrivateKey.class.getName())) {
                return new ElGamalPrivateKeyContentProvider();
            } else if (className.equals(SSVElGamalPrivateKey.class.getName())) {
                return new SSVElGamalPrivateKeyContentProvider();
            } else if (className.equals(MeRSAPrivateKey.class.getName())) {
                return new MeRSAPrivateKeyContentProvider();
            } else if (className.equals(MpRSAPrivateKey.class.getName())) {
                return new MpRSAPrivateKeyContentProvider();
            } else if (className.equals(CMSSPrivateKey.class.getName())) {
                return new CMSSPrivateKeyContentProvider();
            } else if (className.equals(ECPrivateKey.class.getName())) {
                return new ECPrivateKeyContentProvider();
            } else if (className.equals(GMSSPrivateKey.class.getName())) {
                return new GMSSPrivateKeyContentProvider();
            } else if (className.equals(IQDSAPrivateKey.class.getName())) {
                return new IQDSAPrivateKeyContentProvider();
            } else if (className.equals(IQGQPrivateKey.class.getName())) {
                return new IQGQPrivateKeyContentProvider();
            } else if (className.equals(IQRDSAPrivateKey.class.getName())) {
                return new IQRDSAPrivateKeyContentProvider();
            } else if (className.equals(LMOTSPrivateKey.class.getName())) {
                return new LMOTSPrivateKeyContentProvider();
            } else if (className.equals(McElieceCCA2PrivateKey.class.getName())) {
                return new McElieceCCA2PrivateKeyContentProvider();
            } else if (className.equals(MerkleOTSPrivateKey.class.getName())) {
                return new MerkleOTSPrivateKeyContentProvider();
            } else if (className.equals(NiederreiterPrivateKey.class.getName())) {
                return new NiederreiterPrivateKeyContentProvider();
            } else if (className.equals(PFlashPrivateKey.class.getName())) {
                return new PFlashPrivateKeyContentProvider();
            } else if (className.equals(RainbowPrivateKey.class.getName())) {
                return new RainbowPrivateKeyContentProvider();
            } else {
                JCTMessageDialog.showInfoDialog(new Status(IStatus.INFO, KeyStorePlugin.PLUGIN_ID, Messages.ContentProviderFactory_0 + "\n" + Messages.ContentProviderFactory_2));
                return new AbstractKeyNodeContentProvider();
            }
        case KEYPAIR_PUBLIC_KEY:
            if (className.equals(DSAPublicKey.class.getName())) {
                return new DSAPublicKeyContentProvider();
            } else if (className.equals(ElGamalPublicKey.class.getName())) {
                return new ElGamalPublicKeyContentProvider();
            } else if (className.equals(SSVElGamalPublicKey.class.getName())) {
                return new SSVElGamalPublicKeyContentProvider();
            } else if (className.equals(RSAPublicKey.class.getName())) {
                return new RSAPublicKeyContentProvider();
            } else if (className.equals(CMSSPublicKey.class.getName())) {
                return new CMSSPublicKeyContentProvider();
            } else if (className.equals(ECPublicKey.class.getName())) {
                return new ECPublicKeyContentProvider();
            } else if (className.equals(GMSSPublicKey.class.getName())) {
                return new GMSSPublicKeyContentProvider();
            } else if (className.equals(IQDSAPublicKey.class.getName())) {
                return new IQDSAPublicKeyContentProvider();
            } else if (className.equals(IQGQPublicKey.class.getName())) {
                return new IQGQPublicKeyContentProvider();
            } else if (className.equals(IQRDSAPublicKey.class.getName())) {
                return new IQRDSAPublicKeyContentProvider();
            } else if (className.equals(LMOTSPublicKey.class.getName())) {
                return new LMOTSPublicKeyContentProvider();
            } else if (className.equals(McElieceCCA2PublicKey.class.getName())) {
                return new McElieceCCA2PublicKeyContentProvider();
            } else if (className.equals(McEliecePublicKey.class.getName())) {
                return new McEliecePublicKeyContentProvider();
            } else if (className.equals(MerkleOTSPublicKey.class.getName())) {
                return new MerkleOTSPublicKeyContentProvider();
            } else if (className.equals(NiederreiterPublicKey.class.getName())) {
                return new NiederreiterPublicKeyContentProvider();
            } else if (className.equals(PFlashPublicKey.class.getName())) {
                return new PFlashPublicKeyContentProvider();
            } else if (className.equals(RainbowPublicKey.class.getName())) {
                return new RainbowPublicKeyContentProvider();
            } else {
                JCTMessageDialog.showInfoDialog(new Status(IStatus.INFO, KeyStorePlugin.PLUGIN_ID, Messages.ContentProviderFactory_0 + "\n" + Messages.ContentProviderFactory_2));
                return new CertificateContentProvider();
            }
        default:
            break;
    }
    return new CommonContentProvider();
}
Also used : RSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.RSAPublicKeyContentProvider) KeyType(org.jcryptool.crypto.keystore.keys.KeyType) GMSSPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.GMSSPrivateKeyContentProvider) IKeyStoreAlias(org.jcryptool.crypto.keystore.keys.IKeyStoreAlias) MeRSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.MeRSAPrivateKeyContentProvider) ECPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.ECPublicKeyContentProvider) MpRSAPrivateKey(de.flexiprovider.core.mprsa.MpRSAPrivateKey) McEliecePublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.McEliecePublicKeyContentProvider) LMOTSPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.LMOTSPublicKeyContentProvider) PBESecretKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.secretkey.PBESecretKeyContentProvider) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) ECPrivateKey(de.flexiprovider.ec.keys.ECPrivateKey) IQRDSAPrivateKey(de.flexiprovider.nf.iq.iqrdsa.IQRDSAPrivateKey) LMOTSPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.LMOTSPrivateKeyContentProvider) GMSSPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.GMSSPublicKeyContentProvider) McElieceCCA2PrivateKey(de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PrivateKey) IQGQPublicKey(de.flexiprovider.nf.iq.iqgq.IQGQPublicKey) ECSecretKey(de.flexiprovider.ec.keys.ECSecretKey) SSVElGamalPublicKey(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPublicKey) RainbowPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.RainbowPrivateKeyContentProvider) NiederreiterPrivateKey(de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPrivateKey) ECSecretKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.secretkey.ECSecretKeyContentProvider) IQRDSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQRDSAPrivateKeyContentProvider) IQDSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQDSAPrivateKeyContentProvider) DSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.DSAPrivateKeyContentProvider) McElieceCCA2PrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.McElieceCCA2PrivateKeyContentProvider) SSVElGamalPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.SSVElGamalPublicKeyContentProvider) SSVElGamalPrivateKey(de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPrivateKey) MerkleOTSPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.MerkleOTSPrivateKeyContentProvider) CertificateNode(org.jcryptool.crypto.keystore.ui.views.nodes.keys.CertificateNode) MerkleOTSPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.MerkleOTSPublicKeyContentProvider) CMSSPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.CMSSPrivateKeyContentProvider) IQDSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQDSAPublicKeyContentProvider) IQGQPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQGQPrivateKeyContentProvider) IQDSAPrivateKey(de.flexiprovider.nf.iq.iqdsa.IQDSAPrivateKey) CMSSPublicKey(de.flexiprovider.pqc.hbc.cmss.CMSSPublicKey) PFlashPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.PFlashPrivateKeyContentProvider) LMOTSPublicKey(de.flexiprovider.pqc.ots.lm.LMOTSPublicKey) NiederreiterPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.NiederreiterPublicKeyContentProvider) McEliecePublicKey(de.flexiprovider.pqc.ecc.mceliece.McEliecePublicKey) NiederreiterPublicKey(de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPublicKey) RainbowPublicKey(de.flexiprovider.pqc.rainbow.RainbowPublicKey) IQDSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQDSAPublicKeyContentProvider) DSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.DSAPublicKeyContentProvider) IQRDSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQRDSAPublicKeyContentProvider) AbstractKeyNode(org.jcryptool.crypto.keystore.ui.views.nodes.keys.AbstractKeyNode) RainbowPrivateKey(de.flexiprovider.pqc.rainbow.RainbowPrivateKey) CMSSPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.CMSSPublicKeyContentProvider) McElieceCCA2PublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.McElieceCCA2PublicKeyContentProvider) MpRSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.MpRSAPrivateKeyContentProvider) IQDSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQDSAPrivateKeyContentProvider) PFlashPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.PFlashPublicKeyContentProvider) IQDSAPublicKey(de.flexiprovider.nf.iq.iqdsa.IQDSAPublicKey) IQRDSAPublicKey(de.flexiprovider.nf.iq.iqrdsa.IQRDSAPublicKey) DSAPublicKey(de.flexiprovider.core.dsa.DSAPublicKey) ECPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.ECPrivateKeyContentProvider) IQGQPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQGQPublicKeyContentProvider) SSVElGamalPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.SSVElGamalPrivateKeyContentProvider) DSAPrivateKey(de.flexiprovider.core.dsa.DSAPrivateKey) IQDSAPrivateKey(de.flexiprovider.nf.iq.iqdsa.IQDSAPrivateKey) IQRDSAPrivateKey(de.flexiprovider.nf.iq.iqrdsa.IQRDSAPrivateKey) SSVElGamalPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.SSVElGamalPrivateKeyContentProvider) ElGamalPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.ElGamalPrivateKeyContentProvider) IQRDSAPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQRDSAPrivateKeyContentProvider) NiederreiterPrivateKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.NiederreiterPrivateKeyContentProvider) RainbowPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.RainbowPublicKeyContentProvider) GMSSPublicKey(de.flexiprovider.pqc.hbc.gmss.GMSSPublicKey) IQRDSAPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.IQRDSAPublicKeyContentProvider) ElGamalPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.ElGamalPublicKeyContentProvider) SSVElGamalPublicKeyContentProvider(org.jcryptool.crypto.keystore.ui.dialogs.contentproviders.keypair.SSVElGamalPublicKeyContentProvider)

Aggregations

DSAPrivateKey (de.flexiprovider.core.dsa.DSAPrivateKey)1 DSAPublicKey (de.flexiprovider.core.dsa.DSAPublicKey)1 SSVElGamalPrivateKey (de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPrivateKey)1 SSVElGamalPublicKey (de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPublicKey)1 MpRSAPrivateKey (de.flexiprovider.core.mprsa.MpRSAPrivateKey)1 ECPrivateKey (de.flexiprovider.ec.keys.ECPrivateKey)1 ECSecretKey (de.flexiprovider.ec.keys.ECSecretKey)1 IQDSAPrivateKey (de.flexiprovider.nf.iq.iqdsa.IQDSAPrivateKey)1 IQDSAPublicKey (de.flexiprovider.nf.iq.iqdsa.IQDSAPublicKey)1 IQGQPublicKey (de.flexiprovider.nf.iq.iqgq.IQGQPublicKey)1 IQRDSAPrivateKey (de.flexiprovider.nf.iq.iqrdsa.IQRDSAPrivateKey)1 IQRDSAPublicKey (de.flexiprovider.nf.iq.iqrdsa.IQRDSAPublicKey)1 McElieceCCA2PrivateKey (de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PrivateKey)1 McEliecePublicKey (de.flexiprovider.pqc.ecc.mceliece.McEliecePublicKey)1 NiederreiterPrivateKey (de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPrivateKey)1 NiederreiterPublicKey (de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPublicKey)1 CMSSPublicKey (de.flexiprovider.pqc.hbc.cmss.CMSSPublicKey)1 GMSSPublicKey (de.flexiprovider.pqc.hbc.gmss.GMSSPublicKey)1 LMOTSPublicKey (de.flexiprovider.pqc.ots.lm.LMOTSPublicKey)1 RainbowPrivateKey (de.flexiprovider.pqc.rainbow.RainbowPrivateKey)1