@@ -0,0 +1,1407 @@
+package biz.netcentric.cq.tools.actool.configmodel;%0A%0Aimport java.security.KeyFactory;%0Aimport java.security.PrivateKey;%0Aimport java.security.spec.PKCS8EncodedKeySpec;%0A%0Aimport javax.crypto.EncryptedPrivateKeyInfo;%0Aimport javax.crypto.SecretKey;%0Aimport javax.crypto.SecretKeyFactory;%0Aimport javax.crypto.spec.PBEKeySpec;%0A%0Aimport com.adobe.granite.crypto.CryptoSupport;%0A%0Apublic class Key %7B%0A%0A    private PrivateKey key; // the PKCS#8 encrypted key%0A%0A    public PrivateKey getKey() %7B%0A        return key;%0A    %7D%0A%0A    public void setKey(String pemPrivateKey, String encryptedPassword, CryptoSupport cryptoSupport) %7B%0A        if (cryptoSupport == null) %7B%0A            throw new IllegalArgumentException(%22CryptoSupport has not been provided but it is required to deal with PKCS#8 keys.%22);%0A        %7D%0A        String password = cryptoSupport.unprotect(encryptedPassword);%0A        %0A        // PEM to DER encoding%0A        %0A        byte%5B%5D pkcs8Data;%0A        // %0A        PBEKeySpec pbeSpec = new PBEKeySpec(password.toCharArray());%0A        SecretKeyFactory skf = SecretKeyFactory.getInstance(pkinfo.getAlgName());%0A        SecretKey secret = skf.generateSecret(pbeSpec);%0A        EncryptedPrivateKeyInfo pkinfo = new EncryptedPrivateKeyInfo(pkcs8Data);%0A        PKCS8EncodedKeySpec keySpec = pkinfo.getKeySpec(secret);%0A        KeyFactory kf = KeyFactory.getInstance(%22RSA%22);%0A        this.key = kf.generatePrivate(keySpec);%0A    %7D%0A%0A%7D%0A

add keystore support (WIP)