package com.kryptnostic.kodex.v1.security;

import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.InvalidParameterSpecException;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;

import com.kryptnostic.crypto.v1.ciphers.BlockCiphertext;
import com.kryptnostic.crypto.v1.keys.Kodex;
import com.kryptnostic.users.v1.UserKey;

public interface KryptnosticConnection {
    Kodex<String> getKodex();
    PrivateKey decryptPrivateKey( BlockCiphertext encryptedPrivateKey ) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException;
    BlockCiphertext encryptPrivateKey( PrivateKey privateKey ) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidParameterSpecException;
    String getUserCredential();
    UserKey getUserKey();
    String getUrl();
}

@@ -62,405 +62,18 @@
 ity.
-InvalidAlgorithmParameterException;%0Aimport java.security.InvalidKeyException;%0Aimport java.security.NoSuchAlgorithmException;%0Aimport java.security.PrivateKey;%0Aimport java.security.spec.InvalidKeySpecException;%0Aimport java.security.spec.InvalidParameterSpecException;%0A%0Aimport javax.crypto.BadPaddingException;%0Aimport javax.crypto.IllegalBlockSizeException;%0Aimport javax.crypto.NoSuchPaddingException
+PrivateKey
 ;%0A%0Ai
@@ -174,16 +174,80 @@
 .Kodex;%0A
+import com.kryptnostic.kodex.v1.exceptions.types.IrisException;%0A
 import c
@@ -347,24 +347,25 @@
 getKodex();%0A
+%0A
     PrivateK
@@ -436,176 +436,11 @@
 ws I
-nvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, BadPadding
+ris
 Exce
@@ -442,24 +442,25 @@
 sException;%0A
+%0A
     BlockCip
@@ -522,171 +522,11 @@
 ws I
-nvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidParameterSpec
+ris
 Exce
@@ -532,16 +532,17 @@
 eption;%0A
+%0A
     Stri
@@ -561,24 +561,25 @@
 edential();%0A
+%0A
     UserKey 
@@ -592,16 +592,17 @@
 rKey();%0A
+%0A
     Stri

clean up exceptions